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

As a User I expect API's with language filters to respect Always available flag

    Details

    • Sprint:
      Castor Core S7

      Description

      For 5.4, 2014.09 and 5.3.3:
      As 5.3 is a stable version, only the bc changes are introduced in 5.3, see below for further changes introduced in 5.4.

      • Introduce new $useAlwaysAvailable argument for ContentService methods allowing language filtering, false by default
      • Update Search service to pass $fieldFilters 'languages' and 'useAlwaysAvailable' to ContentService->load(), set it to true if not set.

      For 5.4 and 2014.09

      • Change default $matchAlwaysAvailable value of LanguageCode Criterion to true
      • Change default value of $useAlwaysAvailable to true

      Important reminder for 5.3 and 5.4: LanguageCode criterion still must be specified in the search query if one wants to filter by language. $fieldFilters is only present to filter translations on each and every returned Content objects.

        Issue Links

          Activity

          Show
          Benjamin Choquet added a comment - https://github.com/ezsystems/ezpublish-kernel/pull/687
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          PR from André (different approach): https://github.com/ezsystems/ezpublish-kernel/pull/1016

          Show
          Jérôme Vieilledent (Inactive) added a comment - PR from André (different approach): https://github.com/ezsystems/ezpublish-kernel/pull/1016
          Show
          André Rømcke added a comment - Merged in https://github.com/ezsystems/ezpublish-kernel/commit/e173055ef8cd1abcca28413289286bbc676475a4
          Hide
          Eduardo Fernandes (Inactive) added a comment -

          eZP 5.3 depends on the patches from EZP-23116 as well.

          Show
          Eduardo Fernandes (Inactive) added a comment - eZP 5.3 depends on the patches from EZP-23116 as well.
          Hide
          Eduardo Fernandes (Inactive) added a comment - - edited

          $qrySearch = new Query();
           
          $qrySearch->filter = new Criterion\Subtree( "/1/2/120/" );
           
          $fieldFilters = array(
          	'languages' => array( "eng-GB", "ger-DE"),
          	'useAlwaysAvailable' => true
          );
           
          $qryResults = $this->getSvcSearch()->findContent( $qrySearch, $fieldFilters);
          

          Under NodeID 120 folder, I have lots of articles and sub-folders created in "eng-GB", "ger-DE", or "por-BR" languages.
          From what I understood, I should have as result, according to the code, objects from the folder in "eng-GB" and "ger-DE". If an object with AlwaysAvailable exists in other language, it should be displayed as well.

          But I get the error below indicating he's having a problem related with ObjectID 128.
          And that object should not be displayed. First because it's in Portuguese, second because it's an article and, so, without AlwaysAvailable.

          [eZ\Publish\Core\Base\Exceptions\NotFoundException] 
          Could not find 'Content' with identifier 'array (    
          	'id' => 128,                                       
          	'languages' =>                                     
          		array (                                            
          			0 => 'eng-GB',                                   
          			1 => 'ger-DE',                                   
          		),                                                 
          	'versionNo' => 1,                                  
          )' 
           
          [eZ\Publish\Core\Base\Exceptions\NotFoundException]                      
          Could not find 'content' with identifier 'contentId: 128, versionNo: 1'
          

          Is this supposed to happen?

          Show
          Eduardo Fernandes (Inactive) added a comment - - edited $qrySearch = new Query();   $qrySearch->filter = new Criterion\Subtree( "/1/2/120/" );   $fieldFilters = array( 'languages' => array( "eng-GB", "ger-DE"), 'useAlwaysAvailable' => true );   $qryResults = $this->getSvcSearch()->findContent( $qrySearch, $fieldFilters); Under NodeID 120 folder, I have lots of articles and sub-folders created in "eng-GB", "ger-DE", or "por-BR" languages. From what I understood, I should have as result, according to the code, objects from the folder in "eng-GB" and "ger-DE". If an object with AlwaysAvailable exists in other language, it should be displayed as well. But I get the error below indicating he's having a problem related with ObjectID 128. And that object should not be displayed. First because it's in Portuguese, second because it's an article and, so, without AlwaysAvailable. [eZ\Publish\Core\Base\Exceptions\NotFoundException] Could not find 'Content' with identifier 'array ( 'id' => 128, 'languages' => array ( 0 => 'eng-GB', 1 => 'ger-DE', ), 'versionNo' => 1, )'   [eZ\Publish\Core\Base\Exceptions\NotFoundException] Could not find 'content' with identifier 'contentId: 128, versionNo: 1' Is this supposed to happen?
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          [~eduardo.fernandes@ez.no]: First you should show all your code because we cannot see what $this->getSvcSearch()->findContent( $qrySearch, $fieldFilters); is doing...
          There might be an issue here indeed, but cannot confirm with the code presented. Please show raw usage of API. Thanks

          Show
          Jérôme Vieilledent (Inactive) added a comment - [~eduardo.fernandes@ez.no] : First you should show all your code because we cannot see what $this->getSvcSearch()->findContent( $qrySearch, $fieldFilters); is doing... There might be an issue here indeed, but cannot confirm with the code presented. Please show raw usage of API. Thanks
          Hide
          Eduardo Fernandes (Inactive) added a comment -

          QA tracked issue created: EZP-23450

          Show
          Eduardo Fernandes (Inactive) added a comment - QA tracked issue created: EZP-23450
          Hide
          Eduardo Fernandes (Inactive) added a comment -

          QA Tested and Approved

          Show
          Eduardo Fernandes (Inactive) added a comment - QA Tested and Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Benjamin Choquet
            • Votes:
              1 Vote for this issue
              Watchers:
              3 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 days
                3d

                  Agile