Ignore enable fields in dataprocessors to avoid issues with deactivated offers
This commit is contained in:
@@ -66,10 +66,10 @@ class OfferProcessor implements DataProcessorInterface
|
|||||||
$offerUid = (int) $cObj->data['tx_epevents_offer'];
|
$offerUid = (int) $cObj->data['tx_epevents_offer'];
|
||||||
if ($offerUid !== 0) {
|
if ($offerUid !== 0) {
|
||||||
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
||||||
$offer = $repository->findByIdentifier($offerUid);
|
$offer = $repository->forceFindByUid($offerUid)->getFirst();
|
||||||
} else {
|
} else {
|
||||||
$pageUid = $GLOBALS['TSFE']->id;
|
$pageUid = $GLOBALS['TSFE']->id;
|
||||||
$offer = $repository->findOneByDetailPage($pageUid);
|
$offer = $repository->forceFindByDetailPage($pageUid)->getFirst();
|
||||||
}
|
}
|
||||||
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
/** @var \EP\EpEvents\Domain\Model\Offer $offer */
|
||||||
$processedData['offer'] = $offer;
|
$processedData['offer'] = $offer;
|
||||||
|
|||||||
@@ -90,6 +90,34 @@ class OfferRepository extends AbstractRepository
|
|||||||
return $query->execute();
|
return $query->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ignores enable fields to avoid issues with deactivated offed entities
|
||||||
|
*
|
||||||
|
* @param int $uid
|
||||||
|
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||||
|
*/
|
||||||
|
public function forceFindByUid($uid)
|
||||||
|
{
|
||||||
|
$query = $this->createQuery();
|
||||||
|
$query->getQuerySettings()->setIgnoreEnableFields(true);
|
||||||
|
$query->matching($query->equals('uid', $uid));
|
||||||
|
return $query->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ignores enable fields to avoid issues with deactivated offed entities
|
||||||
|
*
|
||||||
|
* @param int $pageUid
|
||||||
|
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||||
|
*/
|
||||||
|
public function forceFindByDetailPage($pageUid)
|
||||||
|
{
|
||||||
|
$query = $this->createQuery();
|
||||||
|
$query->getQuerySettings()->setIgnoreEnableFields(true);
|
||||||
|
$query->matching($query->equals('detail_page', $pageUid));
|
||||||
|
return $query->execute();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $queryString
|
* @param string $queryString
|
||||||
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
|
||||||
|
|||||||
Reference in New Issue
Block a user