|
@@ -9,6 +9,7 @@ use Meramo\Begriffmgt\Domain\Repository\UrlRepository;
|
|
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
|
|
use Meramo\Begriffmgt\Domain\Repository\TermRepository;
|
|
use Meramo\Begriffmgt\Domain\Repository\TermRepository;
|
|
|
use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
|
|
use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
|
|
|
|
|
+use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
|
|
|
|
|
|
|
|
class DashboardController extends ActionController
|
|
class DashboardController extends ActionController
|
|
|
{
|
|
{
|
|
@@ -72,7 +73,16 @@ class DashboardController extends ActionController
|
|
|
$url = $this->urlController->createAction($urlTitle);
|
|
$url = $this->urlController->createAction($urlTitle);
|
|
|
$urlObj = $this->urlRepository->findByUid($url);
|
|
$urlObj = $this->urlRepository->findByUid($url);
|
|
|
$this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj);
|
|
$this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj);
|
|
|
- $this->redirect('index');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $request = $this->request;
|
|
|
|
|
+ if ($request) {
|
|
|
|
|
+ // Called by a form action - in this case the data is persisted to the db 'automatically'
|
|
|
|
|
+ $this->redirect('index');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // Called by another controller
|
|
|
|
|
+ $persistenceManager = $this->objectManager->get(PersistenceManager::class);
|
|
|
|
|
+ $persistenceManager->persistAll();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function deleteTermAction(int $termId): void {
|
|
public function deleteTermAction(int $termId): void {
|