Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Deletion of entries per Backend Module #59

Open
Roritchi opened this issue Mar 3, 2023 · 0 comments
Open

[BUG] Deletion of entries per Backend Module #59

Roritchi opened this issue Mar 3, 2023 · 0 comments

Comments

@Roritchi
Copy link

Roritchi commented Mar 3, 2023

It is not possible to delete the submitted form entries via the backend module, as it always ends up with an error.
The Feature Request this is related to: #34

This only affects Version 3 as far as I know.
Since Version 4 is for TYPO3 11 I would appreciate the bug also being fixed in Version 3, so its possible to use this Extension in TYPO3 10.

The Error was already descripted there:

Call to a member function getDocHeaderComponent() on null

in /var/www/html/public/typo3conf/ext/frp_form_answers/Classes/Controller/FormEntryController.php line 131
        parent::initializeView($view);
        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        
     if ($this->actionMethodName != 'exportAction') {
         $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);

         $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
         $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_core.xlf');

To get around this Error it is possible to change the initializeView Function inside the FormEntryController like this:

/**
     * Set up the doc header properly here
     *
     * @param ViewInterface $view
     * @return void
     */
    protected function initializeView(ViewInterface $view)
    {
        /** @var BackendTemplateView $view */
        parent::initializeView($view);
        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        
	    if ($this->actionMethodName != 'exportAction') {
		    if($view->getModuleTemplate()) {
			    $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);

			    $pageRenderer = $this->view->getModuleTemplate()->getPageRenderer();
			    $pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_core.xlf');

			    $this->createMenu();
			    $this->createButtons();
		    }

	        $view->assign('showSupportArea', $this->showSupportArea());
	    }
    }

The difference is this line: if($view->getModuleTemplate())

I am not familiar enough with the Project to know if this is just a workaround or an actual fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant