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

Call to a member function isEnvironmentInBackendMode() on null #1

Open
idsolutions-maoh opened this issue Jun 23, 2022 · 1 comment · May be fixed by #8
Open

Call to a member function isEnvironmentInBackendMode() on null #1

idsolutions-maoh opened this issue Jun 23, 2022 · 1 comment · May be fixed by #8

Comments

@idsolutions-maoh
Copy link

Bildschirmfoto vom 2022-06-23 17-07-21

hello zeroseven-team,

we have an issue with your extension which makes no sence for us. in backend everything works, but in frontend we get this error: Call to a member function isEnvironmentInBackendMode() on null

please have a look to the screenshot.

we hope you can help us.

regards, markus

@neufeind
Copy link

neufeind commented Mar 7, 2024

$uriBuilder is not instantiated via Extbase thus no injections for the EnvironmentService are processed.

Workaround in AbstractMenu:

replace:
$this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
with:
$objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$this->uriBuilder = $objectManager->get(UriBuilder::class);

neufeind added a commit to neufeind/z7_countries that referenced this issue Mar 18, 2024
This is needed to properly initialize injections etc.

Resolves: zeroseven#1
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 a pull request may close this issue.

2 participants