Details

      Description

      Using Public API you're not able to create an object and try to add to the xmltext fieldtype with

      <link anchor_name="test" href="/test">test</link>
      

      or

      <link anchor_name="test" url="/test">test</link>
      

      You'll always get the following error

      [eZ\Publish\Core\Base\Exceptions\InvalidArgumentException]                                                                           
        Argument 'xmlString' is invalid: Validation of XML content failed: Element 'link', attribute 'xxx': The attribute 'xxx' is not allowed. 
      

        Issue Links

          Activity

          Hide
          André Rømcke added a comment -

          The solution is here to add a ezxml_input.xsd which allows href and url attributes in input, cause the storage engine handler is already cable of transforming these to url_id both ways.

          In other words a slight separation between input format and storage format.

          Show
          André Rømcke added a comment - The solution is here to add a ezxml_input.xsd which allows href and url attributes in input, cause the storage engine handler is already cable of transforming these to url_id both ways. In other words a slight separation between input format and storage format.
          Show
          André Rømcke added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/458
          Show
          André Rømcke added a comment - Merged in https://github.com/ezsystems/ezpublish-kernel/commit/855c835ba2b5465b729a627ab2744c61890d0a38
          Hide
          Marcos Loureiro (Inactive) added a comment - - edited

          Different error now:

          PHP Fatal error:  Undefined class constant 'URL_TABLE' in /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage/Gateway/LegacyStorage.php on line 235
          

          Command: https://gist.github.com/MLoureiro/01a6e5fbc84842a39558

          stack trace:

          PHP Stack trace:
          PHP   1. {main}() /var/www/html/ezpublish52/ezpublish/console:0
          PHP   2. Symfony\Component\Console\Application->run() /var/www/html/ezpublish52/ezpublish/console:27
          PHP   3. eZ\Bundle\EzPublishCoreBundle\Console\Application->doRun() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121
          PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php:41
          PHP   5. Symfony\Component\Console\Application->doRun() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:85
          PHP   6. Symfony\Component\Console\Application->doRunCommand() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191
          PHP   7. Symfony\Component\Console\Command\Command->run() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904
          PHP   8. my\SignalSlotBundle\Command\CreateArticleWithAnchorCommand->execute() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244
          PHP   9. eZ\Publish\Core\SignalSlot\ContentService->createContent() /var/www/html/ezpublish52/src/my/SignalSlotBundle/Command/CreateArticleWithAnchorCommand.php:93
          PHP  10. eZ\Publish\Core\Repository\ContentService->createContent() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php:237
          PHP  11. eZ\Publish\Core\Persistence\Cache\ContentHandler->create() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php:649
          PHP  12. eZ\Publish\Core\Persistence\Legacy\Content\Handler->create() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/ContentHandler.php:35
          PHP  13. eZ\Publish\Core\Persistence\Legacy\Content\Handler->internalCreate() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php:119
          PHP  14. eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler->createNewFields() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php:148
          PHP  15. eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler->createNewField() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/FieldHandler.php:120
          PHP  16. eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/FieldHandler.php:229
          PHP  17. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/StorageHandler.php:60
          PHP  18. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage\Gateway\LegacyStorage->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage.php:23
          PHP  19. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage\Gateway\LegacyStorage->insertLink() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage/Gateway/LegacyStorage.php:163
          

          Show
          Marcos Loureiro (Inactive) added a comment - - edited Different error now: PHP Fatal error: Undefined class constant 'URL_TABLE' in /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage/Gateway/LegacyStorage.php on line 235 Command: https://gist.github.com/MLoureiro/01a6e5fbc84842a39558 stack trace: PHP Stack trace: PHP 1. {main}() /var/www/html/ezpublish52/ezpublish/console:0 PHP 2. Symfony\Component\Console\Application->run() /var/www/html/ezpublish52/ezpublish/console:27 PHP 3. eZ\Bundle\EzPublishCoreBundle\Console\Application->doRun() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121 PHP 4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php:41 PHP 5. Symfony\Component\Console\Application->doRun() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:85 PHP 6. Symfony\Component\Console\Application->doRunCommand() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191 PHP 7. Symfony\Component\Console\Command\Command->run() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904 PHP 8. my\SignalSlotBundle\Command\CreateArticleWithAnchorCommand->execute() /var/www/html/ezpublish52/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244 PHP 9. eZ\Publish\Core\SignalSlot\ContentService->createContent() /var/www/html/ezpublish52/src/my/SignalSlotBundle/Command/CreateArticleWithAnchorCommand.php:93 PHP 10. eZ\Publish\Core\Repository\ContentService->createContent() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php:237 PHP 11. eZ\Publish\Core\Persistence\Cache\ContentHandler->create() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php:649 PHP 12. eZ\Publish\Core\Persistence\Legacy\Content\Handler->create() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/ContentHandler.php:35 PHP 13. eZ\Publish\Core\Persistence\Legacy\Content\Handler->internalCreate() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php:119 PHP 14. eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler->createNewFields() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php:148 PHP 15. eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler->createNewField() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/FieldHandler.php:120 PHP 16. eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/FieldHandler.php:229 PHP 17. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/StorageHandler.php:60 PHP 18. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage\Gateway\LegacyStorage->storeFieldData() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage.php:23 PHP 19. eZ\Publish\Core\FieldType\XmlText\XmlTextStorage\Gateway\LegacyStorage->insertLink() /var/www/html/ezpublish52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/XmlText/XmlTextStorage/Gateway/LegacyStorage.php:163
          Show
          André Rømcke added a comment - Additional fix merged to master in: https://github.com/ezsystems/ezpublish-kernel/commit/bd6d9c132fa96e6f8c8f608e0de45ee07d821d87#commitcomment-3764643
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Pedro Resende (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 5 hours, 45 minutes
                5h 45m