I have a custom .xml Filelist Form Field, used in admin / template style edit, in which I want the user to be able to select either a default favicon.ico file that resides under template/template_name/favicon.ico, or whatever other *.ico file that resides under JPATH_ROOT.
The .xml looks something like this:The problem is that if I select the - Use Default - from the drop down list and then Save the style, the parameter *is* saved correctly in the database (with full path), the favicon on the web page *is* the one expected to be, but the reloaded admin page (right after Save action) shows - None Selected - in that drop down list, and so, while hitting another Save without touching anything else, the parameter from database will now change to "" (i.e. none).
On the other haned, by selecting explicitly whatever valid .ico file further down the list (that lists files under JPATH_ROOT), then the selected name is preserved correctly in the drop down list after a Save action.
It seems to me there is an (undocumented) limitation regarding the - Use Default - behavior. The same happens if I use imagelist instead of filelist type.
Is there a workaround for this behavior ?
The .xml looks something like this:
Code:
<fieldname="favicon"type="filelist"label="WHATEVER"description="WHATEVER_DESC"default="templates/template_name/favicon.ico"fileFilter="\.ico$|\.icon$"></field>
On the other haned, by selecting explicitly whatever valid .ico file further down the list (that lists files under JPATH_ROOT), then the selected name is preserved correctly in the drop down list after a Save action.
It seems to me there is an (undocumented) limitation regarding the - Use Default - behavior. The same happens if I use imagelist instead of filelist type.
Is there a workaround for this behavior ?
Statistics: Posted by secarica — Thu Oct 17, 2024 6:52 am