Injectionerrors on domain class MediaAlbum

Issue #54 resolved
Wim Roukema created an issue

The properties $fileCollectionRepository and $mediaAlbumRepository had the visibility "protected". Made them invisible. Solution: visibility "public" Version: 2.0.1

Comments (8)

  1. Wim Roukema reporter

    Because, with the visibility of "protected", this is the result: Error: Cannot access protected property MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum::$fileCollectionRepository

  2. Frans Saris 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?

  3. Wim Roukema 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.

  4. Log in to comment