 Maarten
|
Thanks @Nigel, I've tested this, but it looks like get_current_user_id() is empty when it's called in get_all_notices(), probably because it's called before all the wordpress functions are loaded. So this solution doesn't seem to work just yet.
Also... it's still setting notices with every ajax call, when the user_id is 0 as well.
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
OK, thanks for the feedback, I've shared it with my colleague, I'll see if he has any alternate suggestions, and will report back here.
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
OK, they additionally suggested making the following change (in the same file) to prevent the notices being updated on ajax requests:
private function save_notices() {
$this->remove_notices();
if ( ! has_action( 'shutdown', array( $this, 'save_to_option' ) ) && !wp_doing_ajax() ) {
add_action( 'shutdown', array( $this, 'save_to_option' ), 1000 );
}
}
Other than that, we'll need to wait for the developers to fully resolve the problem.
|
 Maarten
|
Hey there, any update on this issue? It's still present in the latest WPML...
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
Sorry, it hasn't been fixed in development yet, and you will need to continue to apply the workaround.
|
 Maarten
|
Hey Nigel, it's been a while, any update on this? Issue is still existing. Thanks!
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
Sorry, I checked the internal tickets and it still isn't fixed yet.
It is on a bugs list along with some other confirmed issues. What tends to happen is these get worked on together in a dedicated bug-squashing sprint, but I can't say quite when that will be.
You will need to continue to apply the workarounds for now.
|
 Maarten
|
Hey there, don't want to be an annoying customer... but it's been more than a year now. Any progress?
My logs are still full of these messages...
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
I'm really sorry Maarten, checking again I see no progress.
I have messaged the project manager directly to point out it has now been a year, let's see what they say.
|
 Maarten
|
Did you get a reply Nigel?
|
 Maarten
|
Since it's been 1.5 year... If anybody else has this issue and is tired of updating the plugin each time it gets updated.
```
// fix wpml notices
add_filter('pre_update_option', function ($value, $option, $old_value) {
// Specifically target wpml_notices option
if ($option === 'wpml_notices') {
// Return old value to prevent update
return '';
}
// Return value unchanged for all other options
return $value;
}, 10, 3);
```
|
 Nigel
WPML Supporter since 02/2016
Timezone:
Europe/Madrid (GMT+02:00)
|
Sorry about the lack of progress. The team have been working exhaustively on the upcoming major 4.7 update for many months now, and somewhat peripheral issues like this have been scheduled for once that work completes.
Hopefully that won't be too long and they will be able to address this problem.
|