Details

      Description

      At the Public API documentation, at the:
      https://doc.ez.no/display/EZP/2.+Browsing%2C+finding%2C+viewing
      at the subsection "Displaying values from a Content", on the code, at the part inside the "foreach":

      (...)
      $valueHash = $fieldType->toHash( $field->value );
      (...)

      I believe the $field->value part should be corrected to $field only, since the $field variable is already assigned a value variable type from the line above:
      $field = $content->getFieldValue( $fieldDefinition->identifier );
      Trying to fetch a value variable type parameter from what already seems to be a value variable type doesn't make sense to me.
      Found out while trying to base my code for a controller on this.

        Activity

        Show
        Dominika Kurek added a comment - Fixed in https://doc.ez.no/display/EZP/2.+Browsing%2C+finding%2C+viewing and https://doc.ez.no/display/DEVELOPER/Browsing%2C+finding%2C+viewing
        Hide
        Rui Silva (Inactive) added a comment -

        Hi Dominika Kurek, as said in the description, all it needs to be correct, is to have:
        $valueHash = $fieldType->toHash( $field->value );
        changed to:
        $valueHash = $fieldType->toHash( $field );
        and not:
        $field = $content->getFieldValue( $fieldDefinition->identifier );
        to:
        $field = $content->getField( $fieldDefinition->identifier );
        By doing that second change you're "undoing" the need of the first one, and regressing to the same problem rendering the code incorrect.

        Show
        Rui Silva (Inactive) added a comment - Hi Dominika Kurek , as said in the description, all it needs to be correct, is to have: $valueHash = $fieldType->toHash( $field->value ); changed to: $valueHash = $fieldType->toHash( $field ); and not: $field = $content->getFieldValue( $fieldDefinition->identifier ); to: $field = $content->getField( $fieldDefinition->identifier ); By doing that second change you're "undoing" the need of the first one, and regressing to the same problem rendering the code incorrect.
        Hide
        Rui Silva (Inactive) added a comment -

        You can have one of the two changes, but not both. This means you can have:

        $field = $content->getField( $fieldDefinition->identifier );
        (...)
        $valueHash = $fieldType->toHash( $field->value );
        

        or:

        $field = $content->getFieldValue( $fieldDefinition->identifier );
        (...)
        $valueHash = $fieldType->toHash( $field );
        

        Both previous options are correct, but:

        $field = $content->getField( $fieldDefinition->identifier );
        (...)
        $valueHash = $fieldType->toHash( $field );
        

        is not correct.

        Show
        Rui Silva (Inactive) added a comment - You can have one of the two changes, but not both. This means you can have: $field = $content->getField( $fieldDefinition->identifier ); (...) $valueHash = $fieldType->toHash( $field->value ); or: $field = $content->getFieldValue( $fieldDefinition->identifier ); (...) $valueHash = $fieldType->toHash( $field ); Both previous options are correct, but: $field = $content->getField( $fieldDefinition->identifier ); (...) $valueHash = $fieldType->toHash( $field ); is not correct.
        Hide
        Dominika Kurek added a comment -

        Ah, then I've reverted the change (to the first option you listed), thanks for the clarification.

        Show
        Dominika Kurek added a comment - Ah, then I've reverted the change (to the first option you listed), thanks for the clarification.
        Hide
        Rui Silva (Inactive) added a comment -

        Validated by QA, for master, with the attached bundle.

        Show
        Rui Silva (Inactive) added a comment - Validated by QA, for master, with the attached bundle.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rui Silva (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: