Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 thread is resolved. Here is a description of the problem and solution.

Problem:

Strings Translation cannot be activated because of the error:

Fatal error: Uncaught Exception: Could not add String with arguments: value: xxxxxx S.p.A. allow_empty_value:1 language: en

Solution:

Access you DataBase (usually can be done with PHPMyAdmin) and search for the strings with the context of 'admin_texts_woo' in the 'wp_icl_strings' table. Delete all records with context starting with "admin_texts_woo" and language = "en"

**** Important!!! Please make a backup of your DataBase before you proceed with those steps****

This topic contains 6 replies, has 2 voices.

Last updated by andreaC-50 1 year, 5 months ago.

Assigned support staff: Itamar.

Author Posts
June 28, 2018 at 12:38 pm #2441168

andreaC-50

I'm very likely in the same situation of these two tickets:
- https://wpml.org/forums/topic/fatal-error-uncaught-exception-could-not-add-string-with-arguments-2/
- https://wpml.org/forums/topic/fatal-error-uncaught-exception-class-wpml-register-string-filter-php-line-181/

probably because in the past I've tried to change the default language.

Now I would like to remove the string "admin_texts_woo..." from the database but I cannot access the WPML String Translation because if activated I get the error reported below.

How can I manually clean my database and have my website work again?

The error also block the access to the "Installed plugins" page....

The error message:
Fatal error: Uncaught Exception: Could not add String with arguments: value: xxxxxx S.p.A. allow_empty_value:1 language: en in /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/classes/filters/class-wpml-register-string-filter.php:181 Stack trace: #0 /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/classes/filters/class-wpml-register-string-filter.php(142): WPML_Register_String_Filter->save_string('xxxxxx S.p.A.', true, 'en', 'admin_texts_woo...', '', 'woocommerce_ema...') #1 /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/inc/functions.php(210): WPML_Register_String_Filter->register_string('', 'woocommerce_ema...', 'xxxxxx S.p.A.', true, 'en') #2 /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/inc/admin-texts/wpml-admin-text-import.class.php(86): icl_register_string('admin_texts_woo...', 'woocommerce_ema...', 'xxxxxx S.p.A.', true) #3 /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/inc/admin-texts/wpml-admin-text-import.class in /home/xxxxxxsp/staging/1/wp-content/plugins/wpml-string-translation/classes/filters/class-wpml-register-string-filter.php on line 181

June 30, 2018 at 7:41 pm #2448338

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

Thank you for contacting the WPML support forum.

Do you have the possibility to try what is suggested in the ticket that you are referring to in your first post?
https://wpml.org/forums/topic/fatal-error-uncaught-exception-could-not-add-string-with-arguments-2/
Please see the Brief description (top yellow section of the ticket) for the fix.
You would need to access you DataBase (usually can be done with PHPMyAdmin) and search for the strings with the context of 'admin_texts_woo' in the 'wp_icl_strings' table. Once you find those strings, you will be able to delete them.

Can you try it?

**** Important!!! Please make a backup of your DataBase before you proceed with those steps****

Please let me know if you need help with it.

Thanks,
Itamar.

June 30, 2018 at 7:43 pm #2448339

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Note: Of course that you will need to search for the full name of the string context.
Not only admin_texts_woo but the full name which you have not shared with me.

July 2, 2018 at 9:20 am #2452708

andreaC-50

Hi Itamar,

thank you for your help.

before proceeding I would like to be sure about what to do (I made multiple backup, of course, but anyway ...).

I found 35 records that starts with "admin_texts_woo",
1 with language = it (the original and current default language)
34 with language = en (the language I tried in the past to set as default)

2 record have the field "value" = "xxxxxx S.p.A.", the value mentioned in the error message

Fatal error: Uncaught Exception: Could not add String with arguments: value: xxxxxx S.p.A. allow_empty_value:1 language: en

Should I:
a) delete all records with context starting with "admin_texts_woo"
b) delete all records with context starting with "admin_texts_woo" and language = "en"
c) delete only the records with value = "xxxxxx S.p.A."
d) delete only the "value" fields with value = "xxxxxx S.p.A."
f) other (please specify)

Thanks
Andrea

July 2, 2018 at 11:20 am #2453313

andreaC-50

In a development copy of the website I tried d) and then c) but didn't work.

I tried then
b) delete all records with context starting with "admin_texts_woo" and language = "en"
and the error disappear

Is it OK? or it's too much? There will be some side effects?
I need to be sure before doing the same thing on the production site.

Thank you
Andrea

July 2, 2018 at 6:48 pm #2454920

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Andrea.

I'm not sure why deleting all the admin_texts_woo strings from the DB solved the problem.
I would expect that deleting only the ones with the value = "xxxxxx S.p.A." be enough.
But any way you can always scan WooCommerce for strings again in WPML -> Theme and plugins localization and have those strings back in the 'wp_icl_strings' table. Please see attached screenshot.

In any case, please keep your backups in case something goes wrong.

Regards,
Itamar.

July 4, 2018 at 8:44 pm #2465087

andreaC-50

Hi Itamar, the strings were automatically been recreate when I re-enabled WooCommerce after e temporary deactivation.

This part of the problems we have with this website is fixed.

To complete the fixing of this website I opened a new ticket:
https://wpml.org/forums/topic/clean-errors-reset-wrong-translation-job-and-restart-home-page-translation/

Thank you
Andrea