Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Hook for portal properties not working as expected
Hi,
im trying to make a hook for overriding a property in the properties of liferay(the property for the menu in the My Account portlet)
I've made the hook trought the Eclipse IDE, and added the property to change to the portal.properties like this:
The properties file is in the WEB-INF/src folder.
The liferay-hook.xml is in the WEB-INF folder:
The problem is that, the hook does not remove the menu item that i'm trying to remove.. if i change the property in the portal-ext.properties it works just fine, if i set the property to nothing in the ext properties, the hook works fine, if i just add a menu item in the property, the hook works fine, it just does not want to remove the default item.
Thanks for the help!
im trying to make a hook for overriding a property in the properties of liferay(the property for the menu in the My Account portlet)
I've made the hook trought the Eclipse IDE, and added the property to change to the portal.properties like this:
users.form.my.account.miscellaneous=announcements,display-settings,commentsThe properties file is in the WEB-INF/src folder.
The liferay-hook.xml is in the WEB-INF folder:
<!--?xml version="1.0"?-->
<hook>
<portal-properties>portal.properties</portal-properties>
</hook>The problem is that, the hook does not remove the menu item that i'm trying to remove.. if i change the property in the portal-ext.properties it works just fine, if i set the property to nothing in the ext properties, the hook works fine, if i just add a menu item in the property, the hook works fine, it just does not want to remove the default item.
Thanks for the help!
You're not suppose to "hook" portal.properties because they only hold "default" values. You'll suppose to create a portal-ext.properties file.
It is perfectly OK to override portal.properties using a hook - in fact for user profile type changes this is the recommended route in training and other documentation.
are you sure you are accessing the My Account portlet and not the user update one?
users.form.update.miscellaneous is the property that admin on the control panel will take note of you need to set both.
I'm not sure if this behavior is a result of the bug in GA2 to do with the loading sequence of portal.properties, See http://issues.liferay.com/browse/LPS-29904
That certainly effects the portal-ext.properties but not sure how hooks and other plugins are changed.
are you sure you are accessing the My Account portlet and not the user update one?
users.form.update.miscellaneous is the property that admin on the control panel will take note of you need to set both.
I'm not sure if this behavior is a result of the bug in GA2 to do with the loading sequence of portal.properties, See http://issues.liferay.com/browse/LPS-29904
That certainly effects the portal-ext.properties but not sure how hooks and other plugins are changed.
With hook you can't delete existing values you can only add new ones. If you need to remove some elements just use portal-ext.properties for that.
For some properties the hook used to replace the values on some Liferay version but that was a bug.
For some properties the hook used to replace the values on some Liferay version but that was a bug.
Thanks for the answers!
Im using the "My account" tab in the liferay Control Panel..
So i'm supposed to edit the portal-ext.properties to remove some fields?
p.s. im using the latest version of LR portal (6.1 CE GA2)
Thank!
Im using the "My account" tab in the liferay Control Panel..
So i'm supposed to edit the portal-ext.properties to remove some fields?
p.s. im using the latest version of LR portal (6.1 CE GA2)
Thank!
Community
Company
Feedback