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 Marcos Vinicios Barreto 5 months, 1 week ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
May 2, 2019 at 6:43 pm

EckyBrazzz

I am trying to:Add a custom Flag

Link to a page where the issue can be seen:

I expected to see: A new Flag

Instead, I got: Nothing, blank page after pressing save

May 2, 2019 at 6:52 pm #3728483

EckyBrazzz

Notice: Trying to get property 'flag' of non-object in /home/nginx/domains/domain.com/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/domain.com/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/domain.com/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/domain.com/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/domain.com/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/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php on line 401

Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:13 Stack trace: #0 /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(938): WPML_WP_API->get_file_mime_type('/tmp/phpDZIRG6') #1 /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(559): SitePress_EditLanguages->upload_flag(66) #2 /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(528): SitePress_EditLanguages->handle_flag_post_data(Array, 66) #3 /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(91): SitePress_EditLanguages->update() #4 /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms in /home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php on line 13

May 2, 2019 at 7:33 pm #3728803

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for contacting WPML Support. Before a more detailed look, please, try this basic troubleshooting:

1 - Make sure your server environment meets our minimum requirements as described at: https://wpml.org/home/minimum-requirements/, you can see your current values at your WordPress Dashboard > WPML > Support > Info menu.

2 - Disable all the plugins except the WPML related ones from your WordPress Dashboard > Plugins and see if the issue is gone, if so, activate one plugin at a time untill the culprit one is found.

3 - If the issue persists, temporary change to a default WordPress theme such as the 'TwentySeventeen' theme from your WordPress Dashboard > Appearance > Themes menu.

IMPORTANT: Please, note, a backup is required for security reasons and to avoid any data loss, you can use the https://wordpress.org/plugins/backupwordpress/ plugin for these backup needs.

Please, let me know if the steps above help to fix your issue. Have a nice day.

May 2, 2019 at 8:13 pm #3728995

EckyBrazzz

Well, this is a server issue. On other servers I don't have this problem. I only can't catch where it goes wrong. Already did all the above steps before opening this ticket

2019/05/02 20:15:57 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:15:57 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$
2019/05/02 20:15:58 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/la.png" failed (2: No such fi$
2019/05/02 20:15:59 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:15:59 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$
2019/05/02 20:16:11 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:16:11 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$
2019/05/02 20:16:13 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:16:13 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$
2019/05/02 20:16:39 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:16:39 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$
2019/05/02 20:16:41 [error] 22331#22331: *4591 directory index of "/home/nginx/domains/domain.com/public/wp-content/plugins/sitepress-multilingual-cms/res/flags/" is forbidden, c$
2019/05/02 20:16:41 [error] 22331#22331: *4591 open() "/home/nginx/domains/domain.com/public/wp-content/uploads/flags/en-nz.png" failed (2: No such file or directory), client: 18$

May 4, 2019 at 1:23 pm #3740357

EckyBrazzz

Fixed the fatal error and compiled PHP again with the flag --fileinfo but still got some errors on line 400 and 401. My PHP version is 7.3.5

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;

Will keep this ticket open and post the final solution or bug fix and source forum.

May 4, 2019 at 1:28 pm #3740369

EckyBrazzz

Sorry, ball get bounced back to your support team/ dev team. See hidden link
and some posts before that one.

PHP related now.

May 6, 2019 at 7:40 pm #3752395

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates and sorry for the bit of waiting due the weekend. PHP notices messages will not interfer in the proper funcionality of your plugin, even so it is desirable to understand the cause of it. As a first step I would like to know if you are using the latest version of our plugins as doing so we can garantee compatibility with PHP latest versions, it is also of help to perform the steps of my previous reply and confirm if it is still possible to see any PHP notice. Please, let me know the results, have a nice day.

May 8, 2019 at 10:00 am #3765307

EckyBrazzz

Latest Version 4.2.6 (have lifetime license) with PHP 7.3.5

May 9, 2019 at 1:38 am #3771793

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates. Can you please confirm if you performed the initial troubleshooting provided in my previous reply? It will help us to determine no theme/plugin conflict is happening here. Also if you don't see the same issue happening in another server environment we can conclude WPML is not the cause of your issue here, instead you need to make sure you have a fully compatible server environment to run WPML as described at: https://wpml.org/home/minimum-requirements/. Hope it brings some more clarifications for you, have a nice day.