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

Inconsistent API for addObject()

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • None
    • 3.10.0, 3.10.0beta1, 4.0.0alpha1
    • None

    Description

      Hi

      eZSearch::addObject() is like this:

      static function addObject( $contentObject )
      {
          $searchEngine = eZSearch::getEngine();
          if ( is_object( $searchEngine ) )
          {
              $searchEngine->addObject( $contentObject, '/content/view/' );
          }
      }
      

      Meaning that '/content/view/' is sent as second parameter to the search engine

      eZSearchEngine::addObject() is declared as follows:

      function addObject( $contentObject, $uri )
      

      While in eZSolr it is defined as :

          function addObject( $contentObject, $commit = true )
      

      This causes some bad inconsistency

      This means that when eZ publish uses eZFind to index content, the value of $commit is actually '/content/view/' .....

      I can imagine maybe that the $uri would be nice to know for a search engine, but this is not used. (not even in eZSearchEngine is the variable used).

      However, all function definitions for addObject() should be compatible with each other

      Attachments

        Activity

          People

            pborgerm pborgerm
            vl vl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: