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.

Author Posts
February 22, 2019 at 6:51 pm

esprits

I am trying to:

Link to a page where the issue can be seen: Seems like it's triggered from single-product page

I expected to see: No Error

Instead, I got: SQL syntax error in debug.log

I'll paste error log in private message.

February 22, 2019 at 7:01 pm #3233796

esprits
[22-Feb-2019 15:42:23 UTC] PHP Notice:  Array to string conversion in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 213
[22-Feb-2019 15:42:23 UTC] PHP Notice:  wpdb::prepare est appelée de la mauvaise manière. Type de valeur non supporté (array). Veuillez lire <a href="https://codex.wordpress.org/Debugging_in_WordPress">Débugger dans WordPress</a> (en) pour plus d'informations. (Ce message a été ajouté à la version 4.8.2.) in /home/ksldress/public_html/wp-includes/functions.php on line 4231
[22-Feb-2019 15:42:23 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/ksldress/public_html/wp-includes/wp-db.php on line 1102
[22-Feb-2019 15:43:25 UTC] PHP Notice:  Array to string conversion in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 213
[22-Feb-2019 15:43:25 UTC] PHP Notice:  wpdb::prepare est appelée de la mauvaise manière. Type de valeur non supporté (array). Veuillez lire <a href="https://codex.wordpress.org/Debugging_in_WordPress">Débugger dans WordPress</a> (en) pour plus d'informations. (Ce message a été ajouté à la version 4.8.2.) in /home/ksldress/public_html/wp-includes/functions.php on line 4231
[22-Feb-2019 15:43:25 UTC] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/ksldress/public_html/wp-includes/wp-db.php on line 1102
[22-Feb-2019 15:43:25 UTC] PHP Warning:  Illegal offset type in isset or empty in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 247
[22-Feb-2019 15:43:25 UTC] PHP Notice:  wpdb::prepare est appelée de la mauvaise manière. La requête ne s'attendait qu'à un seul substitutif, mais un tableau de multiples substitutifs a été soumis. Veuillez lire <a href="https://codex.wordpress.org/Debugging_in_WordPress">Débugger dans WordPress</a> (en) pour plus d'informations. (Ce message a été ajouté à la version 4.9.0.) in /home/ksldress/public_html/wp-includes/functions.php on line 4231
[22-Feb-2019 15:43:25 UTC] Erreur de la base de données 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 pour la requête 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 wp_icl_translations wpml_translations
				JOIN wp_posts p
					ON wpml_translations.element_id = p.ID
						AND wpml_translations.element_type = CONCAT('post_', p.post_type)
				    JOIN wp_icl_translations tridt
				      ON tridt.element_type = wpml_translations.element_type
				      AND tridt.trid = wpml_translations.trid
				    WHERE  faite par require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/ksl/woocommerce/single-product.php'), wc_get_template_part, load_template, require('/themes/ksl/woocommerce/content-single-product.php'), do_action('woocommerce_after_single_product_summary'), WP_Hook->do_action, WP_Hook->apply_filters, ksl_show_cross_sells_on_single_product_page, get_slider, WP_Query->__construct, WP_Query->query, WP_Query->get_posts, WP_Query->parse_query, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, SitePress->parse_query, WPML_Query_Parser->parse_query, WPML_Query_Parser->adjust_q_var_pids, WPML_Element_Translation->element_id_in, WPML_Element_Translation->maybe_populate_cache
[22-Feb-2019 15:43:25 UTC] PHP Warning:  Illegal offset type in isset or empty in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 257
[22-Feb-2019 15:43:25 UTC] PHP Warning:  Illegal offset type in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 258
[22-Feb-2019 15:43:25 UTC] PHP Warning:  Illegal offset type in isset or empty in /home/ksldress/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php on line 262

February 25, 2019 at 4:39 am #3237996

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

Could you please go to WPML-> Support ->Troubleshooting and click the below buttons and let me know if that helps:

+ Set Language information
+ Clear Cache in WPML
+ Fix element types collation
+ Assign translation status to duplicated content

Further, If you disable all non-related WPML plugins, switch to one of the default themes, the problem persists or not?
NOTE:
+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!).

Look forward to your reply.

Thanks

February 27, 2019 at 2:18 pm #3250713

esprits

Hi there,

Sorry for the delay.

I can give you access to admin area and FTP credentials if you want to investigate on the issue.

Doing the recommended actions on a staging server generated this error in the debug.log :

[26-Feb-2019 09:24:03 UTC] WordPress database error Unknown column 'wpml_translations.language_code' in 'where clause' for query SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND ( 
  0 = 1 
  AND 
  0 = 1 
  AND 
  0 = 1
) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'ywgc-disabled' OR wp_posts.post_status = 'ywgc-dismissed' OR wp_posts.post_status = 'ywgc-code-not-valid' OR wp_posts.post_status = 'ywcars-new' OR wp_posts.post_status = 'ywcars-processing' OR wp_posts.post_status = 'ywcars-on-hold' OR wp_posts.post_status = 'ywcars-approved' OR wp_posts.post_status = 'ywcars-rejected' OR wp_posts.post_status = 'ywcars-coupon' OR wp_posts.post_status = 'wc-livre-par-camion-' OR wp_posts.post_status = 'wc-stripe-partial-re' OR wp_posts.post_status = 'wc-rupture-de-stocks' OR wp_posts.post_status = 'wc-retour-echange-ex' OR wp_posts.post_status = 'wc-retour-termine-no' OR wp_posts.post_status = 'wc-remboursement-par' OR wp_posts.post_status = 'wc-pre-vente-paye' OR wp_posts.post_status = 'wc-paypal-standard-s' OR wp_posts.post_status = 'wc-paiement-par-cheq' OR wp_posts.post_status = 'wc-paiement-accepte-' OR wp_posts.post_status = 'wc-paiement-a-distan' OR wp_posts.post_status = 'wc-expedie-partielle' OR wp_posts.post_status = 'wc-expedie-par-courr' OR wp_posts.post_status = 'wc-expedie-deuxieme-' OR wp_posts.post_status = 'wc-en-attente-du-fou' OR wp_posts.post_status = 'wc-en-attente-du-cam' OR wp_posts.post_status = 'wc-en-attente-deuxie' OR wp_posts.post_status = 'wc-en-attente-de-rea' OR wp_posts.post_status = 'wc-en-attente-de-pai' OR wp_posts.post_status = 'wc-en-attente-retour' OR wp_posts.post_status = 'wc-emballage-a-rappe' OR wp_posts.post_status = 'wc-emballage' OR wp_posts.post_status = 'wc-demande-de-financ' OR wp_posts.post_status = 'wc-cueillette-bureau' OR wp_posts.post_status = 'wc-colis-perdu-poste' OR wp_posts.post_status = 'wc-awaiting-cod-vali' OR wp_posts.post_status = 'wc-autorisation-acce' OR wp_posts.post_status = 'wc-attente-dun-artic') AND ( ( ( wpml_translations.language_code = 'en' OR (
					wpml_translations.language_code = 'en'
					AND wp_posts.post_type IN ( 'post','product','event' )
					AND ( ( 
			( SELECT COUNT(element_id)
			  FROM wp_icl_translations
			  WHERE trid = wpml_translations.trid
			  AND language_code = 'en'
			) = 0
			 ) OR ( 
			( SELECT COUNT(element_id)
				FROM wp_icl_translations t2
				JOIN wp_posts p ON p.id = t2.element_id
				WHERE t2.trid = wpml_translations.trid
				AND t2.language_code = 'en'
				AND (
					p.post_status = 'publish' OR 
					p.post_type='attachment' AND p.post_status = 'inherit'
				)
			) = 0 ) ) 
				) ) AND wp_posts.post_type  IN ('post','page','attachment','product','product_variation','event','yith-wcbm-badge' )  ) OR wp_posts.post_type  NOT  IN ('post','page','attachment','product','product_variation','event','yith-wcbm-badge' )  ) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[26-Feb-2019 09:24:03 UTC] WordPress database error Unknown column 'wpml_translations.language_code' in 'where clause' for query SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND ( 
  0 = 1 
  AND 
  0 = 1 
  AND 
  0 = 1
) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'ywgc-disabled' OR wp_posts.post_status = 'ywgc-dismissed' OR wp_posts.post_status = 'ywgc-code-not-valid' OR wp_posts.post_status = 'ywcars-new' OR wp_posts.post_status = 'ywcars-processing' OR wp_posts.post_status = 'ywcars-on-hold' OR wp_posts.post_status = 'ywcars-approved' OR wp_posts.post_status = 'ywcars-rejected' OR wp_posts.post_status = 'ywcars-coupon' OR wp_posts.post_status = 'wc-livre-par-camion-' OR wp_posts.post_status = 'wc-stripe-partial-re' OR wp_posts.post_status = 'wc-rupture-de-stocks' OR wp_posts.post_status = 'wc-retour-echange-ex' OR wp_posts.post_status = 'wc-retour-termine-no' OR wp_posts.post_status = 'wc-remboursement-par' OR wp_posts.post_status = 'wc-pre-vente-paye' OR wp_posts.post_status = 'wc-paypal-standard-s' OR wp_posts.post_status = 'wc-paiement-par-cheq' OR wp_posts.post_status = 'wc-paiement-accepte-' OR wp_posts.post_status = 'wc-paiement-a-distan' OR wp_posts.post_status = 'wc-expedie-partielle' OR wp_posts.post_status = 'wc-expedie-par-courr' OR wp_posts.post_status = 'wc-expedie-deuxieme-' OR wp_posts.post_status = 'wc-en-attente-du-fou' OR wp_posts.post_status = 'wc-en-attente-du-cam' OR wp_posts.post_status = 'wc-en-attente-deuxie' OR wp_posts.post_status = 'wc-en-attente-de-rea' OR wp_posts.post_status = 'wc-en-attente-de-pai' OR wp_posts.post_status = 'wc-en-attente-retour' OR wp_posts.post_status = 'wc-emballage-a-rappe' OR wp_posts.post_status = 'wc-emballage' OR wp_posts.post_status = 'wc-demande-de-financ' OR wp_posts.post_status = 'wc-cueillette-bureau' OR wp_posts.post_status = 'wc-colis-perdu-poste' OR wp_posts.post_status = 'wc-awaiting-cod-vali' OR wp_posts.post_status = 'wc-autorisation-acce' OR wp_posts.post_status = 'wc-attente-dun-artic') AND ( ( ( wpml_translations.language_code = 'en' OR (
					wpml_translations.language_code = 'en'
					AND wp_posts.post_type IN ( 'post','product','event' )
					AND ( ( 
			( SELECT COUNT(element_id)
			  FROM wp_icl_translations
			  WHERE trid = wpml_translations.trid
			  AND language_code = 'en'
			) = 0
			 ) OR ( 
			( SELECT COUNT(element_id)
				FROM wp_icl_translations t2
				JOIN wp_posts p ON p.id = t2.element_id
				WHERE t2.trid = wpml_translations.trid
				AND t2.language_code = 'en'
				AND (
					p.post_status = 'publish' OR 
					p.post_type='attachment' AND p.post_status = 'inherit'
				)
			) = 0 ) ) 
				) ) AND wp_posts.post_type  IN ('post','page','attachment','product','product_variation','event','yith-wcbm-badge' )  ) OR wp_posts.post_type  NOT  IN ('post','page','attachment','product','product_variation','event','yith-wcbm-badge' )  ) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/ksl/404.php')
February 28, 2019 at 6:12 am #3253668

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Sure, I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link

These info is private, and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note that:

#1
Backup (both files and database) your site before giving us your credentials. You can use a plugin for this if you like. I often use the Duplicator plugin for this purpose.
See: http://wordpress.org/plugins/duplicator/

Duplicator instruction
hidden link

#2
It would be better if you give me the test site rather than the live site.

#3
If the issues needs some changes in the plugins updates/disabling we will install a plugin called “duplicator” and replicate the site in our local server for testing.

Look forward to your reply.

Thanks

February 28, 2019 at 1:34 pm
March 1, 2019 at 9:25 am #3259200

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

We recently released new versions of WPML plugins with fixes and improvements so could you please update the plugin to the latest version and let me know if this helps?

NOTE:

+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!). You can use a plugin for this if you like. I often use the Duplicator plugin for this purpose. See: http://wordpress.org/plugins/duplicator/

Also, could you please provide me exact steps to replicate the issue?

Look forward to your reply.

Thanks

The topic ‘[Closed] SQL Syntax error warning in debug .log’ is closed to new replies.