Affects Version/s: 7.1.2 CE GA3, 7.1.X
Fix Version/s: None
Component/s: Core Infrastructure
OS:Windows 10, Windows 7
JDK:Oracle Sun JDK 8
Application Servers:Apache Tomcat 9.0.x
Databases:PostgreSQL 9.4, PostgreSQL 9.6
I'm trying to use the new Configuration API to implement a group scoped configuration on a custom portlet.
What I need is a global configuration that the administrator can set as a default configuration; then I want to customize that configuration for each site in which I have different requirements.
I wrote all the Java classes and JSP and it apparently seems to work: the default configuration is correctly saved inside the "configuration" database table as well as the group configuration.
The "ConfigurationProvider" class correctly reads and returns the right configuration.
But if I restart the server or just redeploy the bundle, the group configuraton is lost; the record is on the database but the "ConfigurationProvider" doesn't read it and always returns the default configuration. Unfortunately this make the Configuration API useless.
I attach the JAR file and the sources of my bundle test; I hope my code is correct and did not miss anything.
Step to reproduce
- deploy the attached JAR file
- go to Control Panel -> System settings -> Users
- click on "Configuration scope test" and enter some values for the 3 configuration fields
- save the defaut configuration
- go to the members section of the site administration
- click on "Configuration Scope Test" portlet
- you will see the values from the default configuration set at step 3
- now enter the portlet configuration page and change the configuration values
- save the portlet configuration
- you will see the values from the group configuration set at step 8
- now restart the server or redeploy the bundle
- refresh or reload the page of step 6
- the portlet must display the group configuration but it doesn't; it displays the default configuration