Skip Navigation

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 3.24 hours from now. Thank you for your understanding.

This topic contains 10 replies, has 2 voices.

Last updated by Lauren 1 month, 3 weeks ago.

Assigned support staff: Lauren.

Author Posts
August 1, 2018 at 5:25 am

vaheV

I am trying to: Search anything (for example: դպրոց) on site from the search input on site header

Link to a page where the issue can be seen: hidden link

I expected to see: Existing articles containing search word

Instead, I got: Nothing is found but there are many articles containing that word.

Important note: I was using Polylang but purchased a WPML license and moved to WPML after which the search is not working any more. I followed these steps for migration: https://wpml.org/documentation/related-projects/migrate-polylang-wpml/

I also had to rename .po and .mo files from 'hy' to 'hy_AM' in order to see translated website.

When I turn on the debug mode I can see the following error when searching:

Not unique table/alias: 't'
SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts  LEFT  JOIN wp_icl_translations t
							ON wp_posts.ID = t.element_id
								AND t.element_type = CONCAT('post_', wp_posts.post_type)  LEFT JOIN wp_postmeta pm ON (wp_posts.ID = pm.post_id)  LEFT JOIN wp_term_relationships tr ON (wp_posts.ID = tr.object_id)  LEFT JOIN wp_term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)  LEFT JOIN wp_terms t ON (tt.term_id = t.term_id)  WHERE 1=1  AND wp_posts.ID NOT IN (0,0,0,0,0,0,0) AND ( ((wp_posts.post_title LIKE '%Х¤ХєЦЂХёЦЃ%') OR (wp_posts.post_content LIKE '%Х¤ХєЦЂХёЦЃ%') OR  (pm.meta_key = 'wyz_business_description' AND pm.meta_value LIKE '%Х¤ХєЦЂХёЦЃ%') OR  (pm.meta_key = 'wyz_business_excerpt' AND pm.meta_value LIKE '%Х¤ХєЦЂХёЦЃ%') OR  (pm.meta_key = 'wyz_business_slogan' AND pm.meta_value LIKE '%Х¤ХєЦЂХёЦЃ%') OR  (tt.taxonomy = 'wyz_business_category' AND t.name LIKE '%Х¤ХєЦЂХёЦЃ%') OR  (tt.taxonomy = 'wyz_business_tag' AND t.name LIKE '%Х¤ХєЦЂХёЦЃ%')))  AND (wp_posts.post_password = '')  AND wp_posts.post_type IN ('post', 'page', 'attachment', 'job_listing', 'wyz_business', 'wyz_location', 'essential_grid', 'wyz_offers') AND (wp_posts.post_status = 'publish') AND ( ( ( t.language_code = 'hy' OR 0 ) AND wp_posts.post_type  IN ('post','page','attachment','wyz_business','wyz_business_post','wyz_business_rating','wyzi_claimrequest','wyz_location','wpcf7_contact_form','wyz_offers' )  ) OR wp_posts.post_type  NOT  IN ('post','page','attachment','wyz_business','wyz_business_post','wyz_business_rating','wyzi_claimrequest','wyz_location','wpcf7_contact_form','wyz_offers' )  )  ORDER BY wp_posts.post_title LIKE '%Х¤ХєЦЂХёЦЃ%' DESC, wp_posts.post_date DESC LIMIT 0, 10

When I disable the WPML plugin the search is working.

The second issue is that I can't set the sites language to English from Settings page. It's falling back to hy_AM.

We really need this search issue to be fixed.

Thanks in advance!

August 1, 2018 at 5:35 pm #2602908

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this. Be sure to make a full backup of your site.

You are unable to change the language to English because you don't have English added as one of your languages. Please go to WPML -> Languages ->Add Remove Languages and add English. Then you will be able to translate your content to English and view it on the frontend.

Once this is done, go to WPML -> Support -> Troubleshooting.

Look for 'Clean up' and click the following:
- Synchronize posts taxonomies
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Fix Terms count
- Fix post assignment for translations

After these steps, are you able to see any search results?

August 1, 2018 at 7:27 pm #2603165

vaheV

I tried the suggested steps but with no luck. I still can't see any search results. Every time I search I can see the same mentioned above SQL error message added to the error_log.

August 2, 2018 at 1:36 pm #2605479

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Please try increasing your WP Memory and PHP version. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/

You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Add it above the line /* That's all, stop editing! Happy blogging. */

You may need to ask your hosting provider it update your PHP version. Once we are updated, delete the current debug log and then run a search, and let me know if this error appears again.

August 2, 2018 at 5:59 pm #2606616

vaheV

There are no issues with memory limits. Here are the current values:
Memory limit 256M
Max memory limit 512M

Also updating PHP version will not help. In my local environment the PHP version is 7.1.1 and I receive the same SQL error. SQL error, not PHP error. Probably there is some misconfiguration of WPML. I gave all the access to WordPress and FTP. Could you please take a look?

August 2, 2018 at 6:27 pm #2606698

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I'd like to have you try a few things so we can try to isolate the issue. This is just to help me identify if it might be a conflict with another plugin or theme that is causing the problem.

** IMPORTANT ** Please backup a working copy of site files and database before continuing.

Update all WPML plugins & WordPress core.

Disable all plugins except WPML related and then temporarily change the theme to a default WordPress such as TwentyFifteen. With these settings, is the issue resolved?

If you don't have a testing environment available and cannot test this on your live site, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. This will allow me to set up your site locally and run these tests for you.

Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply. I will also need the username and password of a user that was created before the duplicator package was created.

Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.

I will enable the next reply to be private so only you and I have access to it. Thanks!

August 8, 2018 at 2:04 pm
August 8, 2018 at 6:44 pm #2626119

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for testing that for me. I'm glad we are making some progress. I was unable to install the duplicator files for some reason. Can you please send me a copy of our theme and the toolkit plugin that comes with it so that I can test this on a fresh install? Once I am able to reproduce the issue, I can escalate to our compatibility team and they can reach out to the author to find a solution together. You can upload the theme/plugin files to Google Drive or Dropbox and share the link to download in the next reply, which I have marked as private.

August 8, 2018 at 8:04 pm
August 9, 2018 at 3:17 pm #2629515

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for sending the files. I was able to reproduce on a test site. I have escalated this to our compatibility team and I will update here as soon as I have more information.

August 23, 2018 at 8:04 pm #2671490

vaheV

Hi Lauren,
Can you please check with the compatibility team if they have any news on this issue?

August 24, 2018 at 12:40 pm #2673128

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I'm sorry but I don't have any update at this time. I will continue to check with 2nd tier and report back here as soon as I have more information.

July 27, 2021 at 4:59 pm #9281929

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Fixed in WPML release (4.1.0)