Skip Navigation

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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Mohamed Sayed 1 year, 5 months ago.

Assisted by: Mohamed Sayed.

Author Posts
January 20, 2024 at 2:13 pm #15207234

mikaelL-10

I am trying to: Edit a Modern events Calendar event

Link to a page where the issue can be seen: (You cant.. You need access first

I expected to see: Could edit

Instead, I got: Critical Error

January 21, 2024 at 4:04 pm #15208690

Mohamed Sayed

Hi Mikael,
Thanks for contacting WPML support.

1. Please provide us with the WordPress debug.log, this will allow us to see if any PHP errors are being produced. More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable it, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Then try to reproduce the issue and check if any errors were saved to the debug.log log file inside the /wp-content/ directory.
If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!

2. Kindly check if the issue persists in a minimal environment by following these steps:

- Deactivate all the plugins that are not related to WPML.
- Switch for a moment to a WordPress default theme like Twenty Twenty-one.
- If the issue is gone, activate one by one to see with which one there is an interaction issue.

❌ Please backup your database and website before performing the above test ❌

Kind regards,
Mohamed

January 21, 2024 at 5:13 pm #15208752

mikaelL-10

Last time, the below code change was the fix that worked. It was the same problem then.
Since the update, it does not work anymore.

Dear MIkael,
Andrey from WPML support has added the following message to your support thread:
Critical error
Thank you for your feedback, Jozsef. It could be different issue, to ensure that your problem gets the attention it deserves, please open a new ticket detailing your issue.


@mikaelL-10, Could you please try the following workaround? Go to wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Review/ReviewTranslation.php in the line 46:
right after this line

$postId = $args[2];

add the following

if ( is_object( $args[2] ) && get_class( $args[2] ) == "WP_Post" ) {

$postId = $args[2]->ID;

}

January 21, 2024 at 7:28 pm #15208964

Mohamed Sayed

Hi,

I see from the development ticket escalated to our developers that the fix has not been released yet. Please note that updating the plugin will remove any changes you made to the plugin files.

So kindly create a full backup then try the same workaround provided here: https://wpml.org/forums/topic/critical-error-43/page/2/#post-14707285

The following code is located around line 59 now:

$postId = $args[2];

Kind regards,
Mohamed

January 22, 2024 at 10:25 am #15210394

mikaelL-10

I really would like this to be in the next update!