Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8635

Property Injection in VersionHandler DeltaTask not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • 6.2.25
    • None
    • None

    Description

      We inject properties in the versionHandler like this:

      @Inject(optional = true)
      @Named("smtp.server")
      private Provider<String> smtpServer = () -> "myDefaultValue"; 

      However, there is a different behaviour between extraInstallTasks and a deltaTask.

      For the DeltaTask (after a clean install) the default value is set, even if there is different value configured in the magnolia.properties file.
      In the extraInstallTasks, the value from the magnolia.properties is set correctly.

      I'm expecting that this injection works in both cases exactly the same way and holds the value from the magnolia.properties if one is set.

      Debug Info from getUpdateTask:

      Debug info from getExtraInstallTasks:

      I recommend to update the documentation about the properties, since it uses a deprecated method from 4.5 instead using the new MagnoliaConfigurationProperties, see: https://docs.magnolia-cms.com/product-docs/6.2/Modules/maintaining-your-module.html#_options_2_magnoliaconfigurationproperties

      Futhermore I recommend adding more information about the ability to inject properties with DI.

       

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              atuor Antonio Tuor
              DeveloperX
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD