Closed Komarovski closed 1 year ago
That's annoying, there should be no redirection possible on AJAX calls. Nothing specific to PHP8 comes to my mind.
I have found that same "AssertionError" already was in PHP7 too, but in PHP8 it throws warning by default. Here's some info that I found about "AssertionError" in PHP8: https://php.watch/versions/8.0/assert-throws
Right now I have commented assert function in qtranslate_core.php on line 102. And everything's working on the frontend.
I think we should add some option that will allow users to turn on the development mode, and by default plugin will have production mode enabled - and all this assert checks will be ignored. Since not every hosting provides ability to change INI settings to disable assertation checks.
Can you check if you have HTTP_X_REQUESTED_WITH
= XMLHttpRequest
passed in the Ajax request? Or the same parameter without X
.
I have no explanation about the PHP version though. You may compare the requests.
See #1326.
Fix released in 3.14.2.
I found the explanation about PHP8.0: https://php.watch/versions/8.0/assert-throws.
The default setting of PHP INI has changed to assert.exception=1
from 0
before. That means the assert triggers an exception instead of a simple warning.
This is poorly documented from the official PHP.net, nothing in the PHP8.0 release notes... only in a separate doc about PHP8.0 incompatibilties . See also this patch in github: https://github.com/php/php-src/pull/5925.
I missed your earlier response about exceptions in PHP8.0... but we came to the same conclusion :)
I missed your earlier response about exceptions in PHP8.0... but we came to the same conclusion :)
Hey Herr Vigg, sorry for late reply, yep, in latest version everything works fine with PHP8+, thank you very much for this fix! :)
Hey everyone,
Author of "Advanced Woo Search" plugin is asking - is qTranslate-XT provides some option to exclude some URLs from its language redirections?
Here's the link to a thread I've started on WP: https://wordpress.org/support/topic/ajax-doesnt-work-under-php8/#post-16451942
The problem is next, when I run website on PHP 7.4 "qTranslate-XT" and "Advanced Woo Search" works fine, but when I'm swithing to PHP 8+ versions and starting to search some products with "Advanced Woo Search", in browser console log I get an error:
POST https://antik.ua/?wc-ajax=aws_action 500 jquery-3-6-0.min.js:2
After debuggin I saw that qTranslate-XT on PHP8+ trows an "CRITICAL Uncaught AssertionError".
Can anyone help me to understand what could lead to this error in PHP 8+ and didn't lead to such error in PHP 7.4?
Thanks!