[MAGNOLIA-8635] Property Injection in VersionHandler DeltaTask not working Created: 11/Nov/22  Updated: 23/Oct/23

Status: Open
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.25
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Antonio Tuor Assignee: Unassigned
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2022-11-11-17-00-42-648.png     PNG File image-2022-11-11-17-02-00-695.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Documentation update required:
Yes
Epic Link: DevX Bucket
Team: DeveloperX

 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.

 

 


Generated at Mon Feb 12 04:34:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.