SEBLOD
SEBLOD copied to clipboard
Select Dynamic Cascade - issue in lang extraction in form (should be to lower case)
The tmpl/form.php in Select Dynamic Cascade plugin replaces [lang] with lang_code but does not convert it to lowercase, so that following extraction of values from a JSON field using lang (like JSON_VALUE(field, "$.[lang]")
) does not work. All short (2 chars) lang code are lowercase in Seblod.
I found that a simple fix is to add
$lang_code = strtolower( $lang_code );
after
$languages = explode( ',', @$options2['language_codes'] ); if ( ! in_array( $lang_code, $languages ) ) { $lang_code = @$options2['language_default'] ? $options2['language_default'] : ''; }
at line 91.
Can you confirm?
thanks
Giuse
I see that a new version of select dynamic cascade but this bug is not addressed. I try to better explain the bug in editing:
- on behavior "start" (first stage of cascade): [lang] is replaced with sef lang tag (like "en", "fr", "it") in lowercase.
- on behavior "middle" or "end" (following stages of cascade): the tmpl/form is used and in line 85 there is a "strtoupper" that capitalizes sef lang tag to look for it in the languages codes of the field parameter that by default are set to uppercase, BUT then it replaces [lang] of the cascade query with the uppercase lang tag, so the query does not retrieve values since lang tags are in lowercase in the DB, like for the first stage of the cascade.
A better fix would be to get rid of the "strtoupper" and change default lang tags in the field paramter to lowercase, since sef lang tags are lowercase and they must be lowercase in the database.
@sebastienheraud can you please look at it? thanks
Giuse
hi, any hope to have a feedback on this? thanks
Any news on this?
This bug is on a paid plugin, was issued here almost 2 years ago and with a single line modification (already suggested by my time spent in trouble-shooting) is fixed. Why is it not patched?