Octopoos / SEBLOD

Build high-end websites with SEBLOD®, a CCK for Joomla!
https://www.seblod.com
GNU General Public License v2.0
129 stars 54 forks source link

SD Concat Field bug on php8.1 #728

Closed NativoDigital closed 1 year ago

NativoDigital commented 1 year ago

Hi @ll, If the site is working with Seblod 3 on php8.1, SD Concat Field returns this error when creating or editing a form:

trim(): Argument #1 ($string) must be of type string, array given

The problem is due to one of the values of the SD Concat Field is a FieldX, but it was working ok since many years ago. Any help or fix will be appreciated. Kind regards -Adonay

olivier-nolbert commented 1 year ago

Hi Adonay,

Can you share some details on the SD Concat and the Field X Field configuration because I tried to replicate the problem but no success.

Thx

NativoDigital commented 1 year ago

Hi Olivier,

Thank you. Of course, I will explain it in more detail. We have 3 fields:

  1. A simple text field without storage, just to repeat it through the Field X.
  2. The Field X repeats that field, who is intended to store those words as "SEBLOD ::syntax:: -> Free" in some db table.
  3. The SD Concat Field is used to get those words, and others, in order to create the article metakeys, storing the results as "Standard -> Article -> metakey". Value separator is ", " comma and space.

In "List of Fields" of the SD Concat we have a mix of different values:

#std_field_1#||#std_field_2#||#std_field_3#||[ some text ]||#my_sd_concat_field#||[ fixed metakey 1, fixed metakey 2, fixed metakey 3, fixed metakey 4,]

With php8 if #my_sd_concat_field# is there, the site breaks and the mentioned error appears. I think this is all, but if you need further information do not hesitate to ask me. Best regards

olivier-nolbert commented 1 year ago

Thx Adonay,

I'm able to replicate with your config.

Working on it.

Cheers

olivier-nolbert commented 1 year ago

Hi Adonay,

Could you try this file as a fix? sd_field_concat.php.zip

Let me know, thx

NativoDigital commented 1 year ago

Hi Olivier,

It works perfectly now with php8.x and J3 or J4. Thank you so much!!

sebastienheraud commented 1 year ago

Hi, The extension is now up-to-date (including the fix) on SEBLOD.com: https://www.seblod.com/store/extensions/2191 Thanks, Saba

olivier-nolbert commented 9 months ago

Hi,

Issue's closed, but another fix to try where $db->query() lines has been commented as useless.

Regards,

Olivier sd_field_concat.php.zip

sebastienheraud commented 9 months ago

3.1 released: https://www.seblod.com/store/extensions/2191