• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

HTML digital character in dropdown element

georgie

Member
Hello Fabrik team and community!

I plug Fabrik on a external DB, on which I can not handle myself.
I generate a dropdown list from a table of this external DB (database join element).

No problem, but just a display not very beautiful on values containing HTML digital character.
example:
Code:
...'...
It displays as is.

Can Fabrik interpret these characters on the fly in my drop-down lists?

THX

Georges
 
I think you can do it with "eval options" in "Advanced" (not tested)
$opt->text = htmlspecialchars_decode($opt->text);
 
Hello

Thanks, but I can not handle this.
I have tried:
Code:
$opt->text = htmlspecialchars_decode($opt->text);

Without success, no errors but no change.

Georges
 
ok, ' ( = ') is special, you must use
htmlspecialchars_decode($opt->text,ENT_QUOTES)

You can also try
html_entity_decode($opt->text,ENT_QUOTES)
 
Ahhh, yes good!
Indeed it works perfectly in my databasejoin elements.

Please is there an equivalent for a field element, used in a filter list (with dropdown option)?
I have tried some syntaxs, without success.

Georges
 
I've made some changes to the code that should handle this automatically, for both regular dropdown options (the one you are doing yourself at the moment), and for filters (for most element types).

However, I'm not 100% sure I've gotten it right for all filter types. I've written some standard code that handles entities, tags and translation of options. There's some stuff we need to do for some filter types and not others. For example, we have to strip_tags() for dropdowns and multiselect, but not checkbox, etc. And I'm not quite sure why some of the existing code only does htmlspecialchars for dropdowns.

Anyway ... if @georgie and @troester are happy to do some testing on various filter types and entities (quotes, <, >, &) and encoded entities (&quot;, &#39; etc) ... I'll go ahead and commit the changes. I've done some testing, and I'm reasonably sure I haven't made anything worse, lol.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top