Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-8883

storePage fails if content and title both change

    XMLWordPrintable

Details

    Description

      When using the confluence.pm module, i created a perl script that attempts to modify the title and content of a page at the same time. It fails with this message:

      REMOTE ERROR: java.lang.Exception: com.atlassian.confluence.core.persistence.confluence.StaleObjectStateException: The version of the object to be saved was more than the previous version! at rename.pl line 30

      My script is:

      use Confluence;
      
      my $url = "http://localhost:8090/rpc/xmlrpc";
      my $u = "admin";
      my $p = "password";
      my $space = "~admin";
      
      my $wiki = new Confluence $url, $u, $p;
      
      my $oldPage = {
      	space => $space,
      	title => "ORIGINAL TITLE",
      	content => "original content",
      };
      
      my $page = $wiki->storePage($oldPage);
      
      print "Page created\n";
      
      print $page->{version} . "," . $page->{id} . "," . $page->{title} . "\n";
      
      my $newPage = {
      	space => $space,
      	title => "NEW IMPROVED TITLE",
      	id => $page->{id},
      	version => $page->{version},
      	content => "new content",
      };
      
      $wiki->storePage($newPage);
      print "Page updated\n";
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            9ec56df6fe02 john martin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: