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

Last updated by Shekhar Bhandari 5 months, 1 week ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
May 9, 2019 at 10:23 am #3775133

Steve

Hi, im trying to edit the languages and create a new language for french canadian, when i click save on the languages it gives me the error below.

the language seems to save but the flag hasn't uploaded so doesn't show.

The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

then i get an email from wordpress with the following in:

Error Details
=============
An error of type E_ERROR was caused in line 13 of the file /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php. Error message: Uncaught Error: Call to undefined function mime_content_type() in /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:13
Stack trace:
#0 /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(938): WPML_WP_API->get_file_mime_type('/tmp/phpx0WCFN')
#1 /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(559): SitePress_EditLanguages->upload_flag('add')
#2 /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(650): SitePress_EditLanguages->handle_flag_post_data(Array, 'add')
#3 /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(470): SitePress_EditLanguages->insert_one(Array)
#4 /home/charlesfaramco/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(91): SitePress_EditLanguages->update()
#5 /home/charlesfaramco/public_htm

May 9, 2019 at 10:54 am #3775477

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Welcome to WPML support. I'd be assisting you further on this issue.

Could you please use the solution provided here and let me know if this helps?
https://wpml.org/forums/topic/call-to-undefined-function-mime_content_type-wpml-wp-api-class-php-on-line-1/

Look forward to your reply.

Thanks

May 9, 2019 at 2:36 pm #3777195

Steve

HI, ive enabled that which stops the error but the flag still doesnt seem to upload

cheers

May 10, 2019 at 3:47 am #3781261

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Which file format are you trying to upload as a flag? Did you make changes in the get_file_mime_type function as suggested and tried it?

If the problem still exists, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.

So could you please provide me those details, you will find the needed fields for this below the comment area when you log in to leave your next reply.
hidden link

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

Note:
Backup your sites before providing the credentials or if possible provide credentials for the test site

Also, make sure to provide the flag URL so I can try to upload it.

Look forward to your reply.

Thanks

May 14, 2019 at 4:24 am #3803507

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Checking the DB table icl_flags, there was no row added for the custom language code 'frca',
that is why the flag could not be uploaded and there were errors.

Manually adding the language code to the DB table icl_flags resolved it.

We have added the lang code and uploaded the flag. Can you please confirm everything is OK now?

Thanks!

Kind Regards,
Shekhar

May 14, 2019 at 2:08 pm #3807875

Steve

HI, the french canadian flag looks fine but the usa flag is now also showing the french candadian flag..so i've updated that and it looks fine

thanks!

May 15, 2019 at 3:35 am #3811923

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hello there,

Glad to know the issue is fixed, we can close here.

Have a nice day. 🙂

Kind Regards,
Shekhar