SEBLOD icon indicating copy to clipboard operation
SEBLOD copied to clipboard

Select Dynamic Cascade - issue in lang extraction in form (should be to lower case)

Open Giuse69 opened this issue 3 years ago • 4 comments

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

Giuse69 avatar Sep 01 '21 13:09 Giuse69

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

Giuse69 avatar Oct 15 '21 22:10 Giuse69

hi, any hope to have a feedback on this? thanks

Giuse69 avatar Feb 19 '22 20:02 Giuse69

Any news on this?

Giuse69 avatar Mar 01 '23 12:03 Giuse69

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?

Giuse69 avatar Jul 08 '23 08:07 Giuse69