-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.2.X EE, 7.0.0 M3
-
Fix Version/s: 6.2.2 CE GA3 , 6.2.X EE, 7.0.0 M1
-
Component/s: Core Infrastructure
-
Branch Version/s:6.2.x
-
Backported to Branch:Committed
-
Story Points:5
-
Git Pull Request:
If a null value is set to the preferences, the default value is not used.
e.g.
portletPreferences.setValue(key, null); portletPreferences.getValue(key, someDefaultValue)) == null
According to the specification, "A null value is treated as a non-existent value", thus the default value should be used.
This behavior causes problem during the import process, when the preferences are copied. When there is no value for a key, a null value is copied to the preferences. Querying this value ignores the default value, and returns null, which leads to NullPointerExceptions.
Possible reproduction steps:
1. Create a Site Template
2. Add an RSS portlet to a page, configure it, delete all of the displayed feeds.
3. Create a Site from the template
4. Go to the page with the RSS portlet, modify something the page.
5. At the top of the page, a message is displayed: "This page has been changed since the last update from the site template. "
6. Reset the changes
7. Refresh the page
Result: NullPointerException in the logs.
- relates
-
LPE-12481 Default values are ignored if a null value is set in preferences
-
- Closed
-