-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the plugin ready for new PHP 8.1? #1085
Comments
Usually it's fine with "minor" upgrades - though they call 8.1 a major upgrade, many new features. First look at the depreciations, should be fine: But here I found something with There is an advanced option to use |
Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in wp-content\plugins\qtranslate-xt-3.11.4\qtranslate_core.php on line 832: $vals = preg_split( '/[\s,]+/', strtolower( $ignore_file_types ), -1, PREG_SPLIT_NO_EMPTY ); For |
More info about PHP 8.1 |
Passing null to parameter #3 ($limit) of type int is deprecated.
I don't recommend migrating to PHP 8.1 yet. The fix for Also, there are so many deprecated notices triggered in WP core, even in 5.9. They say it's "just notices in debug mode, no impact on production, no need to panic". But in practice it's very annoying when for developers. It seems they had a huge list of PHP 8.1 deprecations such as Requests to be fixed but only a few of them made their way in WP 5.9. |
I'm doing the first impact assessments in test environments. |
Only 1 bug for php 8.1: Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in D:_web\mix\wp-content\plugins\qtranslate-xt-master\qtranslate_core.php on line 832 $vals = preg_split( '/[\s,]+/', strtolower( $ignore_file_types ), null, PREG_SPLIT_NO_EMPTY ); Simple change NULL to "0" (zero) |
@andreysneg All the But |
So back to the PHP 8.1 compatibility. |
It's been several days I'm looking at this code in qtranslate_date_time.php and still doesn't understand it fully... Such an incredible mess. It's a real nightmare to refactor. |
These functions are so old that some functionalities don't make any sense to me, like allowing a format containing ML values... I'd like to simplify this but it's hard to understand the impact in the user code. I start to have a plan in mind, at least to allow PHP 8.1 to work without warnings on the short run. This will also serve as an experimental API before rolling it out for all. After that there will surely be breaking changes in the legacy API because it's really a mess to maintain. |
I have now merged a first workaround with #1228 specifically for PHP 8.1 (and above). However, it's clear we should abandon the strftime formats completely in qTranslate and only use a standard date format using IntlDateFormatter. We should store the language date and time configuration only in this From now I ask everyone interested in PHP8.1 to test the last version with the |
I received an error notice from Wordpress today, possibly related? Fehler-DetailsEin Fehler vom Typ E_ERROR wurde in der Zeile 167 der Datei { |
@rein2000 ah nice, this is useful. Solutions: References With the last patch I pushed, the strformat formats are still accepted in the settings but they are converted to date at runtime using |
@rein2000 did you try replacing |
Some formats like '%E' are not standard in strftime, but they have been added in qTranslate to mimic some date formats. Complete the conversion tables in the new `qxtranxf_intl_strftime` to support those, for retro-compatibility. Anyway this function is temporary, as strftime formats should not be used anymore. Reorder the mappings in the original converter to better separate non-standard pairs. Note that three of them are not supported in the new function.
I have uploaded a new patch that completes the support of non-standard formats like
So these are supported, but ideally we should not use them because it's not standard. Even worse, there are three pairs that override the strftime format with something specific to qTranslate.
So the conversions are inconsistent 😕 and we should not override them in the new It should now be possible to use PHP 8.1 in a (almost) transparent manner, thanks to this workaround for |
I have now generalized the usage of |
I'm going to upgrade PHP on my server to 8.1, so I want to make sure everything goes smoothly.
The text was updated successfully, but these errors were encountered: