femanager icon indicating copy to clipboard operation
femanager copied to clipboard

[BUGFIX] Fix UserRepository instantiation in UserUtility::getCurrentUser()

Open smirgol opened this issue 2 months ago • 0 comments

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.

smirgol avatar Oct 27 '25 12:10 smirgol