This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 1.02 hours from now. Thank you for your understanding.

This thread is resolved. Here is a description of the problem and solution.

Problem: PHP Notice: wpdb::prepare was called incorrectly. The query only expected one placeholder, but an array of multiple placeholders was sent... Solution: https://wpml.org/forums/topic/conflict-with-acf-gallery-get_field/#post-3654221

This topic contains 12 risposte, has 2 voci.

Last updated by Tommaso 2 settimane, 6 giorni fa.

Assigned support staff: Bruno Kos.

Autore Post
April 19, 2019 at 1:32 pm #3646081

Tommaso

Salve,
Ho appena effettuato l'aggiornamento di Advanced Custom Fields Multilingual alla versione 1.2 e immediatamente ho visualizzato questi warning all'interno del tema (è attivo il debug). Il problema scompare nel momento in cui disattivo ACF Multilingual. Allego anche immagine.

Warning: Illegal offset type in isset or empty in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 247

Notice: wpdb::prepare è stato richiamato in maniera scorretta. La query si aspetta un placeholder, ma è stato passato un array di placeholder. Leggi Debugging in WordPress per maggiori informazioni. (Questo messaggio è stato aggiunto nella versione 4.9.0.) in /wp-includes/functions.php on line 4667

Errore sul database di WordPress: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 9]
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM tp_icl_translations wpml_translations JOIN tp_posts p ON wpml_translations.element_id = p.ID AND wpml_translations.element_type = CONCAT('post_', p.post_type) JOIN tp_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE

Warning: Illegal offset type in isset or empty in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 257

Warning: Illegal offset type in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 258

Warning: Illegal offset type in isset or empty in /wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 262

Grazie.

April 23, 2019 at 7:47 am #3660171

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

I hope you don't mind if I answer in English - if you prefer an Italian supporter, let me know, but some of our Italian supporters are on vacation this week so I am stepping in.

I've used Google Translate to translate you issue and can and in order to debug this issue, I will install Duplicator plugin, will create packages and will try this on my localhost and possibly escalate further to 2nd tier.

https://wpml.org/faq/provide-supporters-copy-site/

Let me know if this is OK with you.

If yes, I will need WordPress admin username and password so I could do this. I have marked your next reply private so you can safely add this information.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Please make a full backup of your site before sharing this info!

Regards,
Bruno Kos

April 23, 2019 at 1:35 pm #3664367

Tommaso

Hi Bruno

Thank you for your reply. Unfortunately, the site is owned by one of my clients and it is not possible for me to assign the administration accesses to the site or install additional plugins to third parties. If you wish, I can download the site from ftp (excluding uploads that are more than 2GB) and export the database.

Tell me if you can accept this solution.

Thanks for the support,
Tommaso

April 23, 2019 at 2:41 pm #3664833

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

If you wish, I can download the site from ftp (excluding uploads that are more than 2GB) and export the database.

Does it mean that you can create a Duplicator package yourself, or that neither you are allowed do to so? If you can do a Duplicator package, that would work also.

https://wpml.org/faq/provide-supporters-copy-site/

I've marked your next reply as private, so that you can add Duplicator package link.

Regards,
Bruno Kos

April 23, 2019 at 2:46 pm #3664977

Tommaso

Hi,

No, I can't instal Duplicator plugin. I will give you the zipped copy of the file in ftp folder and the sql file from the database. I can send all with wetransfer.com. I only need an email.

Tommaso

April 23, 2019 at 2:50 pm #3665017

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I see - can you upload the site into the file sharing service like Dropbox or Google Drive so that I could download it, and put the shareable link into Duplicator link within our private reply template?

Regards,
Bruno Kos

April 24, 2019 at 8:15 am #3670197

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I was able to recreate the site on my localhost. Can you tell me if are able to reach the theme developer perhaps, so that they can debug as well? Because it seems that something in the theme is triggering all of this.

See the image - when I activate Twenty Nineteen theme, errors are gone, so this is theme related conflict as it seems. With Twenty Nineteen being active, errors are neither displayed in the frontend of the site, nor debug.log gets rendered. This is not the case when their theme is active, though.

Regards,
Bruno Kos

April 24, 2019 at 12:57 pm #3673095

Tommaso

Hi,

I took care of the development of the site.

The warning is visible when you use the ACF Gallery custom field which, as you can see, is in the header of the custom theme. Since the custom field is not used within Twenty Nineteen, the warning is not displayed.

Is the warning related to this issue? https://wpml.org/errata/issue-serialized-acf-fields-set-copy/

April 24, 2019 at 2:33 pm #3674139

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for this info - I've asked our 2nd tier about this, I'll get back to you as soon as I have any news or questions for you.

Regards,
Bruno Kos

April 24, 2019 at 4:19 pm #3675065

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I received a feedback from our 2nd tier and here is it:

"The client is using a custom theme, but I think this could be a compatibility issue with ACF functionality, so to prove that we have to try to replicate the same functionality that raises the issue in his custom theme and use it in a default theme to test it."

In other words, any way you can recreate that particular code you are using and suspecting that it raises warnings and notices, perhaps as a child theme of Twenty Nineteen theme? We would do this only to exclude that there is something else in the theme not properly being coded. Let me know if am not 100% clear.

I've created a Sandbox site where you can test this, I will provide credentials in my next private message.

Regards,
Bruno Kos

May 1, 2019 at 7:03 pm #3719489

Tommaso

Hi Bruno.

I'm sorry, but I haven't been able to recreate the problem these days, between work and holidays. Please keep the thread open. I will try to make the changes as soon as possible.

Thanks,
Tommaso

May 2, 2019 at 9:41 am #3723433

Bruno Kos
Supporter

Languages: Inglese (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi Tommaso,

No need for this any more :). Please see this on how to get this resolved (this is workaround though) and what goes next (fix):
https://wpml.org/forums/topic/warnings-with-acf-gallery/#post-3698733

Regards,
Bruno Kos

May 2, 2019 at 4:33 pm #3726989

Tommaso

Ah, ok. Thanks.