Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2244

Joomla! 5.x Coding • Unwanted behavior when including file with path to default field in Filelist from Standard Form Fields

$
0
0
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:

Code:

<fieldname="favicon"type="filelist"label="WHATEVER"description="WHATEVER_DESC"default="templates/template_name/favicon.ico"fileFilter="\.ico$|\.icon$"></field>
The problem is that 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 a (undocumented) limitation regarding the - Use Default - behavior and 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



Viewing all articles
Browse latest Browse all 2244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>