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 14 replies, has 2 voices.

Last updated by Andreas W. 5 months ago.

Assigned support staff: Andreas W..

Author Posts
May 6, 2019 at 8:33 pm #3752569

EckyBrazzz

Tell us what you are trying to do? Get Custom flags

Is there any documentation that you are following? No

Is there a similar example that we can see? Yes on my other sites like hidden link (punny code!)

What is the link to your site? hidden link
can't add custom flags

Notice: Trying to get property 'flag' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 400

Notice: Trying to get property 'from_template' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 401

Notice: Trying to get property 'flag' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 400

Notice: Trying to get property 'from_template' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 401

Notice: Trying to get property 'flag' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 400

Notice: Trying to get property 'from_template' of non-object in /home/nginx/domains/$vhostdomain/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 401

Use PHP 7.3.5

May 6, 2019 at 9:01 pm #3752745

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for contacting WPML Support.

Do I understand right, that you editede custom languages without adding a custom flag for each language?

Custom flags will need to be uploaded for each language at WPML -> Languages - Edit Language.

You will find a selectin of custom flags in your wp-content/plugins folder at:

sitepress-multilingual-cms/res/flags

More information here:
https://wpml.org/2019/01/choosing-the-flags-for-your-sites-languages/

Let me know if you need further assistance.

Kind regards
Andreas

May 8, 2019 at 9:54 am #3765281

EckyBrazzz

sitepress-multilingual-cms/res/flags saves new flags, but they won't display.
It only displays new flags when I make an entry in MySQL.

Guess an PHP issue. Using PHP 7.3.5

May 8, 2019 at 6:15 pm #3769927

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT

Please make a backup of site files and database before providing us access.
If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Kind regards
Andreas

May 8, 2019 at 7:24 pm #3770509

EckyBrazzz

Sorry, new internal company rules. We don't provide login to 3rd party teams after an issue.
See https://wpml.org/forums/topic/brute-force-attack-after-providing-login-to-your-support/

Just inform me the tables I have to alter in my MySQL.

I you want to debug info, I am will to post them here.

May 8, 2019 at 7:52 pm #3770629

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Do I understand the issue correctly? You are trying to add a custom language to WPML And you wish to upload a custom flag?

New flags for custom languages will need to be uploaded here.
WPML -> Languages -> Edit languages

Does the upload for the new flag fail?

Language flags are saved inside the icl_flags table. More information here:
https://wpml.org/documentation/support/wpml-tables/

Why are you trying to add the flag on the table directly?

Kind regards
Andreas

May 8, 2019 at 8:07 pm #3770699

EckyBrazzz

[19:57][root@server6 uploads]# ls -lh flags
total 8.0K
-rw-r--r-- 1 nginx nginx 725 May 8 09:17 Flag_of_Australia_.png
-rw-r--r-- 1 nginx nginx 680 May 6 17:44 New_Zealand.png

It uploads the flag, but won't show up, nor back end and front end.

Thanks for the link https://wpml.org/documentation/support/wpml-tables/

The Flag New_Zealand.png is from an old installation, the entry was in the DB, so I could upload it and worked fine.

May 8, 2019 at 8:27 pm #3771051

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Before we take any further steps please try the following after making a backup of your site and database:

WPML > Support > Troubleshooting. Look for 'Clean up' and click on these buttons:
-- Clear the cache in WPML
-- Remove ghost entries from the translation tables
-- Fix element_type collation
-- Fix WPML Table Collation
-- Set language information

I hope this will solve the issue. Otherwise we need further debugging.

Kind regards
Andreas

May 8, 2019 at 8:30 pm #3771059

EckyBrazzz

Guess we can start debugging because on a fresh site it has the same issue.

May 8, 2019 at 8:46 pm #3771075

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hi,

Would you consider to migrate your site to our test server on Cloudways?

Kind regards
Andreas

May 8, 2019 at 8:55 pm #3771077

EckyBrazzz

Could do so, but it won't track down the issue due to server configuration. There are some special rules like whitelisting in the NGINX configuration.

# Whitelist Exception for mediagrid timthumb
location ~ ^/wp-content/plugins/media-grid/classes/ {
  include /usr/local/nginx/conf/php.conf;
  include /usr/local/nginx/conf/staticfiles.conf;
  # below include file needs to be manually created at that path and to be uncommented
  # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
  # allows you to add commonly shared settings to all wp plugin location matches which
  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/domain/wpsecure_domain.conf
  #include /usr/local/nginx/conf/wpincludes/domain/wpwhitelist_common.conf;
}


# Whitelist Exception for sitepress-multilingual-cms
  location ~ ^/wp-content/plugins/sitepress-multilingual-cms/res/flags/(.+/)?(.+)\.(css|js)$ { allow all; }
  location ~ ^/wp-content/plugins/sitepress-multilingual-cms/res/flags/(.+/)?(.+)\.(png|gif)$ { allow all; }
  location ~* /wp-content/plugins/sitepress-multilingual-cms/res/flags/.*\.php$ {
#    include /usr/local/nginx/conf/php.conf;
#    allow 127.0.0.1;
#    deny all;
}

Notice: Trying to get property 'flag' of non-object in /home/nginx/domains/${vhostname}/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 400

Notice: Trying to get property 'from_template' of non-object in /home/nginx/domains/${vhostname}/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 401

Code snip of these lines:

$this->active_languages[$lang['code']]['flag'] = $flag->flag;
$this->active_languages[$lang['code']]['from_template'] = $flag->from_template;
May 9, 2019 at 4:38 pm #3778117

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for your message.

I have consulted our second tier in regards to this issue and I will be contacting you as soon I received feedback.

Kind regards
Andreas

May 14, 2019 at 10:47 pm #3810981

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for your patience.

After consulting our second tier support we would like to encourage you to upload the flag through the WPML settings only (“Edit languages”).

And I’m afraid that due to timely matters and the fact that WPML does offer a default method to add custom flags, we can’t asssist to solve the server issues which you are expereincing. Maybe you can temporary disable specific rules while uploading the flag.

We hope for your understanding.

Kind regards
Andreas

May 14, 2019 at 11:40 pm #3811055

EckyBrazzz

Already tried to do it that way, but it did not work.

I do have some old MariaDB's with some custom flags, so I will find out how they got stored inside the DB and name them in correctly inside the flags directory.

Guess there is no other option.

May 15, 2019 at 6:03 pm #3819309

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I do understand right, that the upload for custom flags at WPML -> Languages -> Edit languages does not work?

I suppose that it behaves the same if you use a default theme and the WPML app only?

If so, I would advise you to contact a certified developer who might be able to help you with this server issue here:
https://wpml.org/contractors/

Kind regards
Andreas