Hallo Philipp, noch mal ich: Problem ist gelöst !!! :-) Der ursächliche Fehler lag zwar wo ganz anders, aber deine Erklärung hat mir wirklich weitergeholfen. Nochmals vielen Dank für die Hilfe! :-) Joahnnes.
> -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:typo3-german- > [email protected]] Im Auftrag von Chris Wolff - AERTiCKET AG > Gesendet: Mittwoch, 11. Juni 2014 08:57 > An: German TYPO3 Userlist > Betreff: Re: [TYPO3-german] Hilfe bei Fehleranalyse > > Hi Johannes, > > dein LogicalAnd Constraint benötigt zwei Parameter. > > Die jeweils vom Typ Constraint Sind. > > du füllst dort momentan einfach ein Array ein. Und so funktioniert das meines > wissen nicht. > > Du must also den ersten und den zweiten parameter des arrays mit einem And > combinieren. > dann den dritten paramter und das ergebnis der ersten operation. > Etc. > > Kurzes beispiel wie ein code dafür ausehen könnte (ungetest tipfehler > vorbehalten): > // ein constraint aus dem array holen und array verküzen $finalconstraint = > array_pop($categoryConstraints) > > foreach ($categoryConstraints as $category){ > $finalconstraint = $query->logicalAnd($finalconstraint,$category) > } > > Gruss chris > > > > > > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:typo3-german- > [email protected]] Im Auftrag von JCL - Johannes C. Laxander > Gesendet: Dienstag, 10. Juni 2014 19:48 > An: 'German TYPO3 Userlist' > Betreff: [TYPO3-german] Hilfe bei Fehleranalyse > > 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.p > hp 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. > > _______________________________________________ > TYPO3-german mailing list > [email protected] > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german > _______________________________________________ > TYPO3-german mailing list > [email protected] > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german _______________________________________________ TYPO3-german mailing list [email protected] http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
