WAIT: Post shows Message while saving: "Error on save: code 200"

Browser: FF 142.0.1
OS: macOS 12.7.6
URL:
Video: https://www.dropbox.com/scl/fi/8xiipilgh8u9qv96d1gr9/Bildschirmaufnahme-2025-09-18-um-11.54.57.mov?rlkey=ivzlschbh2tz0kyvf31689oax&st=vzexi6em&dl=0

While saving a post, it shows error message: “Fehler beim Speichern (Error while saving)”.
Server request returns 200 OK. So if I leave the page, alert informs about unsaved changes.
After reloading the builder window, everything seems to be fine and post had been saved.
Not a big deal but slightly confusing. :slight_smile:

I guess this is related to WAIT: Error on Save: HTTP Code 200

Hi,

yeah, could be related. However, we did not get a response there, so can you check the “response” tab of the save request? Is there anything special there?

Does this happen even if you remove all elements from the page, or if you only have one simple one, like basic text?

Also, can you try to disable all plugins and check again?

Please let me know,
Matej

Hi,

like shown in the video at first sight the response shows a 200 OK.
As this is just the plain status code returned from successful ajax request, I took a deeper look into.

And guess what: it is an error from WPML thrown in class-wpml-translation-element.php:85

Uncaught InvalidArgumentException: Argument $language_code must be a non empty string

This breaks the JSON in response and after that, it results in an error message in bricks.

Here’s the ajax response json:

(JSON part of save response looked fine, so I missed that part out)
That points to a successful save action in bricks but in a broken ajax response back to bricks.

// correct JSON part was here. – php error starts here:
<br />
<b>Fatal error</b>:  Uncaught InvalidArgumentException: Argument $language_code must be a non empty string. in /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:85
Stack trace:
#0 /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(845): WPML_Translation_Element-&gt;get_translation(NULL, true)
#1 /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(778): WPML_Media_Attachments_Duplication-&gt;get_translated_attachment_id(566, NULL)
#2 /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(795): WPML_Media_Attachments_Duplication-&gt;{closure}(Array)
#3 /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(800): WPML_Media_Attachments_Duplication-&gt;{closure}(Array)
#4 /is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(754): WPML_Media_Attachments_Duplication-&gt;translate_bricks_media(Array, NULL)
#5 /is/htdocs/{REPLACED_SERVER_URL}/wp-includes/class-wp-hook.php(324): WPML_Media_Attachments_Duplication-&gt;maybe_translate_medias_in_posts('')
#6 /is/htdocs/{REPLACED_SERVER_URL}/wp-includes/class-wp-hook.php(348): WP_Hook-&gt;apply_filters(NULL, Array)
#7 /is/htdocs/{REPLACED_SERVER_URL}/wp-includes/plugin.php(517): WP_Hook-&gt;do_action(Array)
#8 /is/htdocs/{REPLACED_SERVER_URL}/wp-includes/load.php(1304): do_action('shutdown')
#9 [internal function]: shutdown_action_hook()
#10 {main}
  thrown in <b>/is/htdocs/{REPLACED_SERVER_URL}/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php</b> on line <b>85</b><br />

I’m experiencing the exact same. Chrome 1.82.170, macOS 15.6.1
Theres a warning in the console:

WPML installed?
take a look into the response detail and look for broken json.
Click on the marked arrow.

With WPML installed, this is the recommended solution from WPML support (yeah, seriously :smile:)

They also referred to this WPML forum posts:

Hmm i cant see the exact problem. There is a parse-error:

We don’t use WMPL, but TranslatePress, ACSS and SureCart. Maybe its an issue with a SureCart Element in Bricks…

sounds pretty similar i guess.

sorry, i was wrong regarding the mentioned item in response:
you’ll have to look for the responseText entry (which might be a lot of text so scroll to the end).
in my installation, the error is located at the end of the response.

Hey @larsactionhero thanks for getting back to this. I could resolve it in the meantime with switching to gutenberg on that page which told me that there are errors while rendering some blocks. after hitting “try to recover block” (or a similar message) and saving, everything worked again as expected in bricks. so there was only something going on in the editor data which gutenberg good resolve. sorry i really can’t remember what i’ve done before but i DEFINITELY did not worked in gutenberg before… strange but fixed for me now…

Hi @sitedock,

I know you didn’t use WPML but I still think it is related to similar cause: broken JSON in server response due to an PHP error.

For all of you having the exact same error with WPML Multilingual CMS 4.8.0 :
WPML has verified the issue and offered a temporary (imho an ugly) workaround:

https://wpml.org/errata/bricks-builder-save-error-code-200/