Injectionerrors on domain class MediaAlbum
The properties $fileCollectionRepository and $mediaAlbumRepository had the visibility "protected". Made them invisible. Solution: visibility "public" Version: 2.0.1
Comments (8)
-
repo owner -
reporter Because, with the visibility of "protected", this is the result: Error: Cannot access protected property MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum::$fileCollectionRepository
-
repo owner Can you add the full stacktrace?
I'm interested where/when this happens
-
reporter - attached exception.html
It is in the attached html-file.
-
repo owner Then I propose to create
inject*()
methods instead of the@inject
annotation -
repo owner But I don't fully understand why I didn't get this error. All documentation I can find states that
@inject
works for non public properties. Do you know if something changed in the core related to this? -
reporter I found: Deprecation: #86907 - Deprecate usage of dependency injection with non public properties in the changelog for typo3 9.5.x
Migration The easiest, yet ugliest migration is to make the property public. If possible, switch to constructor or setter injection instead.
-
repo owner - changed status to resolved
- Log in to comment
Why do you want these public?