Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22964

5.x API contentUpdate for eZXml adds entry to ezurl, but not to ezurl_object_link

    XMLWordPrintable

Details

    Description

      When creating or updating ezxml field content through the public API, an entry is created in the ezurl table, but not to the ezurl_object_link table.

      This causes the urls to later be incorrectly considered "orphaned" and removed (see eZUrl fieldType).

      This behavior is reproducible in eZ Publish 5.2

      With something like the following:

      $content = $contentService->loadContent( $contentId );
      
      $contentXmlString = <<<EZXML
      <?xml version="1.0" encoding="utf-8"?>
      <section
          xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"
          xmlns:image="http://ez.no/namespaces/ezpublish3/image/"
          xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/">
          <paragraph>This is a <link href="http://overlink.com">paragraph link.</link></paragraph>
      </section>
      EZXML;
      
      $cleanEzxmlInput = new EzXml( $contentXmlString );
      
      $contentInfo = $contentService->loadContentInfo( $contentId );
      $contentDraft = $contentService->createContentDraft( $contentInfo );
      $contentUpdateStruct = $contentService->newContentUpdateStruct();
      
      // updates the content
      $contentUpdateStruct->setField( 'body', $cleanEzxmlInput );
      
      $contentDraft = $contentService->updateContent( $contentDraft->versionInfo, $contentUpdateStruct );
      $content = $contentService->publishVersion( $contentDraft->versionInfo );
      

      You will be able to see the link being added to the ezurl table, but not to ezurl_object_link table, and it should, like it does when creating/editing contend from the administration backend.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ricardo.correia-obsolete@ez.no Ricardo Correia (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 45 minutes
                3h 45m