-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.0 CE GA1
-
Fix Version/s: 6.1.1 CE GA2, 6.1.20 EE GA2, 6.2.0 CE M2
-
Branch Version/s:6.1.x
-
Backported to Branch:Committed
liferay-portal-6.1.0-ce-ga1 with tomcat-7.0.23 and Hypersonic
1. Use MinimalAssetEntryValidator as validation class in portal-ext.properties
Input a class name that extends
com.liferay.portlet.asset.util.BaseAssetEntryValidator. This class will be
called to validate entries. The DefaultAssetEntryValidator class is just
an empty class that doesn't actually do any validation. The
MinimalAssetEntryValidator requires all entities to have at least one tag.
#
#asset.entry.validator=com.liferay.portlet.asset.util.DefaultAssetEntryValidator
asset.entry.validator=com.liferay.portlet.asset.util.MinimalAssetEntryValidator
2. Put Asset Publisher Portlet on Page
3. Add New Basic Web Content or any other
4. Fill out required fields
5. Add at least one tag
6. Save will throw error that at least one tag must be specified
Debugging the code:
The validate method is called twice when at least one tag is added to the asset. First call is ok and the tagNames String is valid, but in the second call the tagNames String is null and thus the validation fails.
Additonal node:
If no tag is added to the asset, the tagNames String is not null and empty throwing the Validation Exception as expected, also the method is only called once.
I didn't get further why the method is called twice. Might also affect custom validation classes.
- relates
-
LPE-6168 Unable to add assets with comments when using MinimalAssetEntryValidator
-
- Closed
-