Copying a page Action with JSON custom content properties when collaborative editing off throw exception page

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Start confluence
      2. Create a page
      3. add json page property to a page by this 
        curl --user admin:admin --verbose --silent --request POST "http://localhost:1990/confluence/rest/api/content/<contentId>/property" --header 'Content-type: application/json' --data-raw '
        {
            "key":"test-key",
            "value": "test-value"
        }' 
      1.  Turn off Collaborative Editing.
      2. Copy page with ... -> Copy page

      Expected Results

      Page should be copy and all json property

      Actual Results

      The below exception is thrown in the xxxxxxx.log file:

      Cause
          com.atlassian.confluence.api.model.validation.SimpleValidationResult.lambda$static$0(SimpleValidationResult.java:35)
      
      Stack Trace:[hide]
      com.atlassian.confluence.api.service.exceptions.BadRequestException: Cannot create new content property: JsonContentProperty{id='null', key='test-key', content=CollapsedReference{idProperties={version=CollapsedReference{idProperties={number=1}, referentClass=class com.atlassian.confluence.api.model.content.Version}, id=ContentId{id=0}, status=draft}, referentClass=class com.atlassian.confluence.api.model.content.Content}, version=null}: [SimpleMessage{key='contentproperty.invalid.content', args=[], translation='null'}]
      	at com.atlassian.confluence.api.model.validation.SimpleValidationResult.lambda$static$0(SimpleValidationResult.java:35)
      	at com.atlassian.confluence.api.model.validation.SimpleValidationResult.convertToServiceException(SimpleValidationResult.java:84)
      	at com.atlassian.confluence.api.model.validation.ValidationResult.throwIfNotSuccessful(ValidationResult.java:197)
      	at com.atlassian.confluence.plugins.contentproperty.ContentPropertyServiceImpl.create(ContentPropertyServiceImpl.java:62)
      	at  

      Workaround

      Workaround 1: Turn on collaborative editing on

      Workaround 2: Remove json page properties for original page

      Workaround 3: Edit original page and copy page content to the new page.

       

            Assignee:
            Quan Pham
            Reporter:
            Quan Pham
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: