Skip to content

Conversation

@smirgol
Copy link

@smirgol smirgol commented Oct 27, 2025

When using makeInstance() to get the UserRepository in getCurrentUser(), the inject methods (like injectPersistenceManager) might not get called under certain circumstances in TYPO3 v13.

This can cause "Typed property Repository::$persistenceManager must not be accessed before initialization" errors when the repository is used.

Changed to use container->get() instead of makeInstance() which ensures proper dependency injection.

Tested with TYPO3 v13.4.

Copy link
Contributor

@sebastianstein sebastianstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like an incorrect commit slipped into the pull request. Since the ObjectManager was already removed with TYPO3 V12. And the pull request description correctly referred to the Dependency Injection Container.

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.

2 participants