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

Resend confimration from Backend causes Error #335

Closed
bh-teufels opened this issue Feb 18, 2021 · 10 comments
Closed

Resend confimration from Backend causes Error #335

bh-teufels opened this issue Feb 18, 2021 · 10 comments

Comments

@bh-teufels
Copy link

use the resend confirmation function in the Backend Module Causes the following error

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1476107295: PHP Warning: Creating default object from empty value in /app/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 700 | TYPO3\CMS\Core\Error\Exception thrown in file /app/web/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 130. Requested URL: http://development.localhost/typo3/index.php?route=%%2Fmodule%%2Fweb%%2FFemanagerM1&token=--AnonymizedToken--&id=3&tx_femanager_web_femanagerm1%%5BuserIdentifier%%5D=13&tx_femanager_web_femanagerm1%%5Baction%%5D=resendUserConfirmationRequest&tx_femanager_web_femanagerm1%%5Bcontroller%%5D=UserBackend

Typo3: 10.4.13
PHP 7.4
femanager: 6.1.2

and is it possible to resend confirmation to all users in the list with one click?
-> would you suggest to make a scheduler task that fetches all the users from the DB and calls the resendUserConfirmationRequestAction from the UserBackendController?

@MaxGTR
Copy link

MaxGTR commented Feb 21, 2021

Problem comes from method "isMailEnabled" in "public/typo3conf/ext/femanager/Classes/Domain/Service/SendMailService.php".
Error with method "cObjGetSingle" from sysext/frontend (TS parsing).
If you remove this call mail is sent but with backend URL in links.

@bh-teufels
Copy link
Author

bh-teufels commented Apr 8, 2021

if ($this->contentObject->cObjGetSingle($typoScript['embedImage'], $typoScript['embedImage.'])) { [...] }
if ($this->contentObject->cObjGetSingle($typoScript['receiver.']['email'], $typoScript['receiver.']['email.']){ [...] }
in "public/typo3conf/ext/femanager/Classes/Domain/Service/SendMailService.php" also causes this Error

seems that every call inside "public/typo3conf/ext/femanager/Classes/Domain/Service/SendMailService.php" $this->contentObject->cObjGetSingle causes this Error

@bh-teufels
Copy link
Author

if i remove all $this->contentObject->cObjGetSingle Calls the mail is send but like MaxGTR said with BackendURL Links and with click on these neither confirm nor delete ist working.

will his be fixed?
Can i generate the confirmation & delete Link on other ways an build my own mail?

@bh-teufels
Copy link
Author

Is there any Solution for this Problem?
i need to resend confirmation mail to 1000 fe users using a task wich checks the not confirmed yet and wanted to using the sendCreateUserConfirmationMail() Function from \In2code\Femanager\Controller\UserBackendController

@bh-teufels
Copy link
Author

Problem ist that ContentObjectRenderer -> cObjGetSingle need TypoScriptFrontendController but is not initalized so both ( $this->typoScriptFrontendController AND $GLOBALS['TSFE']) are NULL

/**
 * @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
 */
protected function getTypoScriptFrontendController()
{
    return $this->typoScriptFrontendController ?: $GLOBALS['TSFE'];
}

@bh-teufels
Copy link
Author

seems to be same issue cause as in2code-de/luxletter#45

@bh-teufels
Copy link
Author

With the "help" from
https://github.com/jweiland-net/luxletter_extended
i got it that i could send confirmation or invitation mails from a task but
the link (f:link.action) is build with route=%2Fmodule%2Fsystem%2FtxschedulerM1 and end up in the BE > Scheduler
(from where the action was called / the mail was send)

how could the target be replaced to the actual wanted page uid?
put pageUID in f:link.action does not work

Invitation.html-Template:
<f:link.action pageUid="123" action="edit" controller="Invitation" absolute="1" arguments="{user:user, hash:hash}">
<f:translate key="emailInvitationLinkConfirm" />
</f:link.action>

@boettner-it
Copy link

You may try this untested example:

use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Service\ExtensionService;

$site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($pageUid);
$extensionService = GeneralUtility::makeInstancet(ExtensionService::class);
$argumentsPrefix = $extensionService->getPluginNamespace($extensionName, $pluginName);
$arguments = [
    $argumentsPrefix => [
      'action' => $actionName,
      'controller' => $controllerName,
      'foo' => 1,
    ],
];
$uri = (string)$site->getRouter()->generateUri((string)$pageUid, $arguments);

@bh-teufels
Copy link
Author

@boettner-it Thank you very much that worked for me

@sbusemann
Copy link
Contributor

in the main version 8 the functionality works in general (at the moment I need to fix the controller in order for a to wrong permission check).

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

No branches or pull requests

4 participants