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

Prevent BE logout in Scheduler module #134

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Prevent BE logout in Scheduler module #134

merged 1 commit into from
Jun 20, 2024

Conversation

mbrodala
Copy link
Member

In TYPO3v12 opening the Scheduler module which contains Searchable indexing tasks did lead to a BE logout.

The reason for this was the "initializeUserSessionManager()" call as performed for all indexing commands. Commands registered as Scheduler tasks are instantiated once to collect them for display in the module. Due to said session manager initialization the existing BE user session was replaced with an anonymous one, effectively resulting in a BE logout.

However, we cannot drop this call completely since it is necessary for the clipboard access in "TYPO3\CMS\Backend\Form\FormDataProvider"; this fails with a BE user without initialized session.

So for now we avoid this issue by checking for the type of the BE user. We now only initialize the user session manager for CLI; in BE/Scheduler everything is already set up.

See https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-93023-ReworkedSessionHandling.html
And https://github.com/TYPO3/typo3/blob/4140e8553a2e59045afcf1d4c7287f229f547189/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaGroup.php#L97

In TYPO3v12 opening the Scheduler module which contains Searchable
indexing tasks did lead to a BE logout.

The reason for this was the "initializeUserSessionManager()" call as
performed for all indexing commands. Commands registered as Scheduler
tasks are instantiated once to collect them for display in the module.
Due to said session manager initialization the existing BE user session
was replaced with an anonymous one, effectively resulting in a BE
logout.

However, we cannot drop this call completely since it is necessary for
the clipboard access in "TYPO3\CMS\Backend\Form\FormDataProvider"; this
fails with a BE user without initialized session.

So for now we avoid this issue by checking for the type of the BE user.
We now only initialize the user session manager for CLI; in BE/Scheduler
everything is already set up.

See https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-93023-ReworkedSessionHandling.html
And https://github.com/TYPO3/typo3/blob/4140e8553a2e59045afcf1d4c7287f229f547189/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaGroup.php#L97
@mbrodala mbrodala merged commit bdda852 into master Jun 20, 2024
4 checks passed
@mbrodala mbrodala deleted the scheduler-logout branch June 20, 2024 14:15
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

Successfully merging this pull request may close these issues.

1 participant