[TYPO3-german] Hilfe bei Fehleranalyse

JCL - Johannes C. Laxander jc at laxander.com
Tue Jun 10 19:48:08 CEST 2014


Hallo,

mit dieser Fehlermeldung weiß ich wenig anzufangen und brauche deshalb Eure Hilfe:
 
#1: PHP Catchable Fatal Error: Argument 2 passed to TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory::_and() must implement interface TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface, null given, called in /.../sysext/extbase/Classes/Persistence/Generic/Query.php on line 384 and defined in /.../sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php line 102

Ich vermute mal, dass es mit diesem Code in meinem Repository zu tun hat:

Class CruiseRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
  public function findBySelectedCriteria($settings) {
    /**
      * Alle Records bereitstellen, die den ausgewählten Kategorien
      * in den Plugin-Einstellungen entsprechen 
      **/
    $query = $this->createQuery();
    $constraints = array();
    ...
    $constraints[] = $this->createCategoryConstraint($query, $categories);
    ...
  }
}


/**
 * Returns a category constraint created by a given list of categories
 *
 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
 * @param  array $categories
 * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface|null
 */
protected function createCategoryConstraint($query, $categories) {
  $constraint = NULL;
  $categoryConstraints = array();

  if (!is_array($cruiseTypes)) {
    $categories = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $categories, TRUE);
  }
  foreach ($categories as $category) {
      $categoryConstraints[] = $query->contains('categories', $category);
  }

  $constraint = $query->logicalAnd($categoryConstraints);
  
  return $constraint;
}

Kann mir jemand nen Tipp geben, worauf die Fehlermeldung abzielt und welche Stelle meines Codes falsch ist?

Gruß, Johannes.



More information about the TYPO3-german mailing list