This is the official repository of the TYPO3 extension powermail! Powermail is a well-known, editor-friendly, powerful and easy mailform extension for TYPO3
The Powermail Plug-in collects, while it is added to a page in TYPO3 backend, all available forms and only shows those for which the logged-in user has the necessary rights by checking if the user has access to the parent page (tx_powermail_domain_model_form.pid). If this page does not exist in the database any more ("hard" deleted, NOT pages.deleted=1) a wrong type is returned (false instead of array) and the error occurs.
How to test
Login as a regular editor (NOT admin)
Create a page/sys folder
On this page/sys folder create a Powermail form
Delete the page/sys folder but not the form in the database ("hard", means delete the complete row in the pages table)
Try to add a Powermail Plug-in to a random page as a non-admin
Possible fix
In app/public/typo3conf/ext/powermail/Classes/Domain/Repository/PageRepository.php change the return type of getPropertiesFromUid() to mixed since fetchAssociative() can possibly return false.
/**
* @param int $uid
- * @return array
+ * @return mixed
* @throws Exception
* @throws ExceptionDbal
*/
- public function getPropertiesFromUid(int $uid): array
+ public function getPropertiesFromUid(int $uid)
{
$connection = DatabaseUtility::getConnectionForTable('pages');
return $connection->executeQuery('select * from pages where uid=' . (int)$uid . ' limit 1')->fetchAssociative();
}
Issue
The Powermail Plug-in collects, while it is added to a page in TYPO3 backend, all available forms and only shows those for which the logged-in user has the necessary rights by checking if the user has access to the parent page (
tx_powermail_domain_model_form.pid
). If this page does not exist in the database any more ("hard" deleted, NOTpages.deleted=1
) a wrong type is returned (false
instead ofarray
) and the error occurs.How to test
Possible fix
In
app/public/typo3conf/ext/powermail/Classes/Domain/Repository/PageRepository.php
change the return type ofgetPropertiesFromUid()
tomixed
sincefetchAssociative()
can possibly returnfalse
.