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

Selection & relation(list) fieldtypes not nameable

    Details

      Description

      Currently, the getName() method for 'ezselection' is not implemented, in \eZ\Publish\Core\FieldType\Selection\Type.php:

      /**
       * Returns the name of the given field value.
       *
       * It will be used to generate content name and url alias if current field is designated
       * to be used in the content name/urlAlias pattern.
       *
       * @param mixed $value
       *
       * @return string
       */
      public function getName( SPIValue $value )
      {
          throw new \RuntimeException( 'Implement this method' );
      }
      

      Please implement it.

        Issue Links

          Activity

          Hide
          André Rømcke added a comment -

          With 16.02 out we have started to explore what kind of changes are needed on our interfaces for this, PR: https://github.com/ezsystems/ezpublish-kernel/pull/1605

          Show
          André Rømcke added a comment - With 16.02 out we have started to explore what kind of changes are needed on our interfaces for this, PR: https://github.com/ezsystems/ezpublish-kernel/pull/1605
          Show
          André Rømcke added a comment - - edited Merged to master: https://github.com/ezsystems/ezpublish-kernel/commit/37968298eb4d2583781f694e906807d3b2359cb8 Additional fixes: https://github.com/ezsystems/ezpublish-kernel/commit/6afed6889acf265934cb31266a691c70edd11a16 For XmlTextFieldType: https://github.com/ezsystems/ezplatform-xmltext-fieldtype/commit/8785d6245c99fddd7586ddf8b67e92a9a0b7130e
          Hide
          Rui Silva added a comment -

          While testing this, on several runs, QA got the following results:

          On a master:
          Testing on Debian 8 with PHP5.6, with the patches:

          Testing field "Selection":
          Create a content type with a field "Selection" with Identifier "selection", and Name Pattern "<selection>", when I create content of this content type, I can see it is name after the "selection" pattern, as expected;
          Same happens for "Relation" and "Relation List" (after their related contents' names respectively)

          Testing field "Richtext":
          Create a content type with a field "RichText" with Identifier "rich", and Name Pattern "<rich>", when I create content of this content type with a richtext field value of some text "This is a richtext" inserted with the richtext editor, I can publish it as expected and visualize it afterwards with the name "This is a richtext" (however if you separate your input text onto several paragraphs only the first paragraph is taken into account, and QA does not know if this is intended or not)

          Testing field "Page":
          Try to create a content type with a field "Layout" (which is "page internally by identifier) I cannot create it because there is a problem on a dropdown without any values on its field;

          On a 5.4 (installed from the tarball and updated as accordingly to the official procedure under the instructions at the doc:

          The first patch does not apply whatsoever:

          checking file eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryFactory.php
          checking file eZ/Bundle/EzPublishCoreBundle/EzPublishCoreBundle.php
          checking file eZ/Bundle/EzPublishCoreBundle/Resources/config/papi.yml
          checking file eZ/Publish/API/Repository/FieldType.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/BaseIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/BinaryFileIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/CheckboxIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/CountryIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/EmailAddressIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/FloatIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/ISBNIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/ImageIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/IntegerIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/KeywordIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/MapLocationIntegrationTest.php
          checking file eZ/Publish/API/Repository/Tests/FieldType/MediaIntegrationTest.php
          can't find file to patch at input line 467
          Perhaps you used the wrong -p or --strip option?
          The text leading up to this was:
          --------------------------
          |diff --git a/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php
          |index ab9475f..6229707 100644
          |--- a/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php
          |+++ b/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php
          --------------------------
          

          Removing the code that affects the tests from the first patch ( simply to check how it would behave since tests would not affect functionality), applying it thereafter, and then applying the second I get the following results:

          Testing on CentOS7 with PHP5.4, I try to access the URL and I get the error on the Apache logs:

          [Wed Apr 13 16:20:20.670548 2016] [:error] [pid 2538] [client 192.168.2.34:59420] PHP Fatal error:  Class 'eZ\\Bundle\\EzPublishCoreBundle\\PassConfig' not found in /var/www/html/ezpublish54/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/EzPublishCoreBundle.php on line 54
          

          Show
          Rui Silva added a comment - While testing this, on several runs, QA got the following results: On a master: Testing on Debian 8 with PHP5.6, with the patches: Testing field "Selection": Create a content type with a field "Selection" with Identifier "selection", and Name Pattern "<selection>", when I create content of this content type, I can see it is name after the "selection" pattern, as expected; Same happens for "Relation" and "Relation List" (after their related contents' names respectively) Testing field "Richtext": Create a content type with a field "RichText" with Identifier "rich", and Name Pattern "<rich>", when I create content of this content type with a richtext field value of some text "This is a richtext" inserted with the richtext editor, I can publish it as expected and visualize it afterwards with the name "This is a richtext" (however if you separate your input text onto several paragraphs only the first paragraph is taken into account, and QA does not know if this is intended or not) Testing field "Page": Try to create a content type with a field "Layout" (which is "page internally by identifier) I cannot create it because there is a problem on a dropdown without any values on its field; On a 5.4 (installed from the tarball and updated as accordingly to the official procedure under the instructions at the doc : The first patch does not apply whatsoever: checking file eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryFactory.php checking file eZ/Bundle/EzPublishCoreBundle/EzPublishCoreBundle.php checking file eZ/Bundle/EzPublishCoreBundle/Resources/config/papi.yml checking file eZ/Publish/API/Repository/FieldType.php checking file eZ/Publish/API/Repository/Tests/FieldType/AuthorIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/BaseIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/BinaryFileIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/CheckboxIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/CountryIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/DateAndTimeIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/DateIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/EmailAddressIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/FloatIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/ISBNIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/ImageIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/IntegerIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/KeywordIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/MapLocationIntegrationTest.php checking file eZ/Publish/API/Repository/Tests/FieldType/MediaIntegrationTest.php can't find file to patch at input line 467 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php b/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php |index ab9475f..6229707 100644 |--- a/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php |+++ b/eZ/Publish/API/Repository/Tests/FieldType/PageIntegrationTest.php -------------------------- Removing the code that affects the tests from the first patch ( simply to check how it would behave since tests would not affect functionality), applying it thereafter, and then applying the second I get the following results: Testing on CentOS7 with PHP5.4, I try to access the URL and I get the error on the Apache logs: [Wed Apr 13 16:20:20.670548 2016] [:error] [pid 2538] [client 192.168.2.34:59420] PHP Fatal error: Class 'eZ\\Bundle\\EzPublishCoreBundle\\PassConfig' not found in /var/www/html/ezpublish54/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/EzPublishCoreBundle.php on line 54
          Hide
          Rui Silva added a comment -

          Tested and approved by QA for 5.4 and master.

          Show
          Rui Silva added a comment - Tested and approved by QA for 5.4 and master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Nuno Oliveira
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: