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

Criterion\LanguageCode is ignored for Criterion\Field

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: High High
    • None
    • 5.4.0
    • None
    • LAMP

    Description

      The following code is used to build a menu on a multilanguage site. If 'show_in_menu' is '1' just in one language the menu entry is visible, regardless if the attribute is set in that concrete language. That's not what we intended at all!

              $criteria = array();
              $criteria[] = new Criterion\Visibility( Criterion\Visibility::VISIBLE );
              $criteria[] = new Criterion\ParentLocationId( $location->id );
              $criteria[] = new Criterion\ContentTypeIdentifier( array( 'article', 'folder' ) );
              $criteria[] = new Criterion\LanguageCode( $languages );
              $criteria[] = new Criterion\Field( 'show_in_menu', Criterion\Operator::EQ, 1 );
      
              $query = new LocationQuery(
                  array(
                      'criterion' => new Criterion\LogicalAnd( $criteria ),
                      'sortClauses' => array( new SortClause\Location\Priority( LocationQuery::SORT_ASC ) )
                  )
              );
              $query->limit = 12;
      
              $menuEntryList = $this->buildListFromSearchResult( $this->getRepository()->getSearchService()->findLocations( $query ) );
      

      Do we get a solution for this problem?

      Attachments

        Activity

          People

            Unassigned Unassigned
            cici cici
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: