Skip to content

Commit

Permalink
[BUGFIX] add persistAll() to add-method because otherwise the entry w…
Browse files Browse the repository at this point in the history
…on’t save
  • Loading branch information
Jonas Hirschi committed Aug 17, 2022
1 parent cb97379 commit 731af22
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Classes/Domain/Repository/FormEntryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Frappant\FrpFormAnswers\Database\QueryGenerator;
use Frappant\FrpFormAnswers\Domain\Model\FormEntryDemand;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException;
use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use Frappant\FrpFormAnswers\Utility\BackendUtility;
Expand Down Expand Up @@ -46,6 +47,22 @@ public function setRespectStoragePage($bool)
$this->setDefaultQuerySettings($querySettings);
}


/**
* Adds an object to this repository
*
* @param object $object The object to add
* @throws IllegalObjectTypeException
*/
public function add($object)
{
if (!$object instanceof $this->objectType) {
throw new IllegalObjectTypeException('The object given to add() was not of the type (' . $this->objectType . ') this repository manages.', 1248363335);
}
$this->persistenceManager->add($object);
$this->persistenceManager->persistAll();
}

/**
* Finds all FormEntries given by conf Array
* @param \Frappant\FrpFormAnswers\Domain\Model\FormEntryDemand $formEntryDemand
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '4.0.0',
'version' => '4.0.1',
'constraints' => [
'depends' => [
'typo3' => '11.3.0-11.5.99',
Expand Down

0 comments on commit 731af22

Please sign in to comment.