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.

This topic contains 8 replies, has 2 voices.

Last updated by Bobby 1 month ago.

Assigned support staff: Bobby.

Author Posts
September 8, 2019 at 2:13 pm

torben-evaldH

I am trying to:
Setup WPML on fresh installation of wordpress+woocommerce

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

I expected to see:
A least one langauge in the dropdown-box instead of nothing

Instead, I got:
Nothing in the dropdown-box

Minimum requirements should be met, but your support-page reports, that the memory-limit is 40M. However it is set for 128M in wp-config.php

September 9, 2019 at 8:23 am #4534561

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

this is a new installation of WPML correct ? meaning that you have not created any translations yet on this site.

if that is correct please go to WPML->support->Troubleshooting->RESET WPML

after reset delete the plugin and re install a fresh version downloaded from here
=> https://wpml.org/downloads/

September 9, 2019 at 9:28 am #4535265

torben-evaldH

Hi
Thank you for your reply.
Yes, this is a new installation of WPML.
I did as instructed, same result - there's still no languages to choose from during setup.
I noticed that I got this message during activation:
"The plugin generated 9784 characters of unexpected output during activation. If you notice “ headers already sent ” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."
I don't know if that's because I've enabled debug.

September 9, 2019 at 3:57 pm #4538767

torben-evaldH

You have an error in your code
wp-content/plugins/sitepress-multilingual-cms/inc/setup/wpml-installation.class.php
in function refresh_active_lang_cache

You are selecting 10 fields in that SQL-query, but you are only grouping by one field. You should add all the fields to the group by.
[php]
SELECT
l.code,
l.id,
english_name,
nt.name AS native_name,
major,
active,
default_locale,
encode_url,
tag,
lt.name AS display_name
FROM {$this->wpdb->prefix}icl_languages l
JOIN {$this->wpdb->prefix}icl_languages_translations nt
ON ( nt.language_code = l.code AND nt.display_language_code = l.code )
LEFT OUTER JOIN {$this->wpdb->prefix}icl_languages_translations lt ON l.code=lt.language_code
WHERE {$active_snippet}
( lt.display_language_code = %s
OR (lt.display_language_code = 'en'
AND NOT EXISTS ( SELECT *
FROM {$this->wpdb->prefix}icl_languages_translations ls
WHERE ls.language_code = l.code
AND ls.display_language_code = %s ) ) )
GROUP BY l.code
[php]

September 9, 2019 at 7:30 pm #4539909

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

i can see that the installation has worked now. Were you able to install WPML as expected ?

thank you for providing the above code, did that resolve the said issue ?

September 9, 2019 at 7:36 pm #4539921

torben-evaldH

Yes, it installed as expected when I corrected the query.
The code I provided was the faulty query in your code.
If you change it to this, it should work:

            SELECT
              l.code,
              l.id,
              english_name,
              nt.name AS native_name,
              major,
              active,
              default_locale,
              encode_url,
              tag,
              lt.name AS display_name
                        FROM {$this->wpdb->prefix}icl_languages l
                        JOIN {$this->wpdb->prefix}icl_languages_translations nt
                          ON ( nt.language_code = l.code AND nt.display_language_code = l.code )
            LEFT OUTER JOIN {$this->wpdb->prefix}icl_languages_translations lt ON l.code=lt.language_code
                        WHERE {$active_snippet}
                          ( lt.display_language_code = %s
                          OR (lt.display_language_code = 'en'
                            AND NOT EXISTS ( SELECT *
                                  FROM {$this->wpdb->prefix}icl_languages_translations ls
                                  WHERE ls.language_code = l.code
                                    AND ls.display_language_code = %s ) ) )
            GROUP BY l.code,
              l.id,
              english_name,
              native_name,
              major,
              active,
              default_locale,
              encode_url,
              tag,
              display_name
September 9, 2019 at 7:41 pm #4539971

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for providing the above sql query

i was not able to reproduce the issue on a clean environment but i will be updating our developers

September 9, 2019 at 7:46 pm #4539977

torben-evaldH

You need to ensure that you have a database where the ONLY_FULL_GROUP_BY SQL mode is enabled. It 's enabled by default. For MySQL it was introduced at version 5.7.5.
What is your procedure for fixing this kind of bugs?

September 9, 2019 at 7:54 pm #4540015

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Our developers will be updated regarding this and i will make sure to pass along the above information you have provided