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

As a User I expect API's with language filters not cause exceptions when used without languageCode criterions

    XMLWordPrintable

    Details

      Description

      • Create a command and add the following code to the execute method
      protected function execute( InputInterface $input, OutputInterface $output ){
      
      	$repository = $this->getContainer()->get( 'ezpublish.api.repository' );
      	$searchService = $repository->getSearchService();
      	
      	$qrySearch = new Query();
      
      	$qrySearch->filter = new Criterion\Subtree( "/1/2/141/" );
      	
      	$fieldFilters = array(
      		'languages' => array( 'eng-GB', 'ger-DE'),
      		'useAlwaysAvailable' => true
      	);
      	
      	$qryResults = $searchService->findContent( $qrySearch, $fieldFilters);  
      
      	echo( 'Found ' . $qryResults->totalCount . " items with language criterion: \n" );
      	foreach ( $qryResults->searchHits as $result )
      	{
      		echo( "#### " . $result->valueObject->contentInfo->name . "\n" );
      	}               
      	
      }
      

      If under the object with nodeId 141 you create always available objects in languages different from 'eng-GB' or 'ger-DE', you will get an exception.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: