Redirections cancelled by qtranxf_can_redirect
should not assert
#1326
Labels
bug
Something isn't working, reproducible
core
Core functionalities, including the admin section
severity: critical
Critical functionality
There's an inconsistency between the
qtranxf_can_redirect
check and theassert
that is triggered if the request can't be redirected.The idea of
assert
was to notify to the user wrong requests with undefined language. However that doesn't hold well for example with AJAX requests coming from third-party plugins (not detected as admin requests), CLI commands, ... Ideally the language should be properly set, but it is impossible to assume that all plugins use the WordPress URL functions that are hooked by qTranslate such ashome_url()
. There might be several issues connected to that problem.Most of the requests should still work using the default language or first in the list (to be clarified). For some cases example update requests writing in DB it could be problematic to use the wrong language but that would be a developer bug due to a wrong URL usage, not a bug from qTranslate.
For now the best is to simply skip the assert. Even a warning would be problematic for example with AJAX requests.
In the future we may want to notify these cases differently for the admin for example with separate logs that won't impact the HTTP functionalities.
The text was updated successfully, but these errors were encountered: