Skip to content
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

PHP 8 with Arabic translation causes a fatal error. #9016

Closed
mihaijoldis opened this issue Dec 13, 2021 · 5 comments · Fixed by #9018 or #9024
Closed

PHP 8 with Arabic translation causes a fatal error. #9016

mihaijoldis opened this issue Dec 13, 2021 · 5 comments · Fixed by #9018 or #9024

Comments

@mihaijoldis
Copy link
Contributor

Bug Report

Expected behavior

Updating EDD on PHP 8 to work correctly.

Actual behavior

A fatal error occurs.

Steps to reproduce the behavior

Apparently it happens when customer tries to update EDD while on PHP 8:

[11-Dec-2021 17:17:33 UTC] PHP Fatal error: Uncaught ValueError: Unknown format specifier "�" in /var/web/site/public_html/wp-content/plugins/easy-digital-downloads/includes/post-types.php:52
PHP Stacktrace:

/var/web/site/public_html/wp-content/plugins/easy-digital-downloads/includes/post-types.php(52): sprintf('\xD8\xA3\xD8\xB6\xD9\x81 %1$ \xD8\xAC\xD8\xAF...', '\xD8\xA7\xD9\x84\xD8\xAA\xD9\x86\xD8\xB2\xD9\x8A\xD9\x84', '\xD8\xA7\xD9\x84\xD8\xAA\xD9\x86\xD8\xB2\xD9\x8A\xD9\x84\xD8...')
/var/web/site/public_html/wp-includes/class-wp-hook.php(303): edd_setup_edd_post_types('')
/var/web/site/public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
/var/web/site/public_html/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
/var/web/site/public_html/wp-settings.php(578): do_action('init')
/var/web/site/public_html/wp-config.php(103): require_once('/var/web/site/p...')
/var/web/site/public_html/wp-load.php(50): require_once('/var/web/site/p...')
/var/web/site/public_html/wp-blog-header.php(13): require_once('/var/web/site/p...')
/var/web/site/public_html/index.php(17): require('/var/web/site/p...')
{main} thrown in /var/web/site/public_html/wp-content/plugins/easy-digital-downloads/includes/post-types.php on line 52 

Seems to work if you disable the languages/easy-digital-downloads-ar.mo file

Information (if a specific version is affected):

PHP Version: 8.0

EDD Version (or branch): latest

WordPress Version: latest

Any other relevant information:
Reported here https://secure.helpscout.net/conversation/1724170844/1694242?folderId=5762562

@ashleyfae
Copy link
Contributor

I'm inclined to say we just remove that.

@robincornett
Copy link
Contributor

Since repository translations are all handled on wordpress.org, and have been for years, should we consider removing all of the .mo files from the plugin? They all look like they're significantly out of date based on the dates on GitHub.

@ashleyfae
Copy link
Contributor

I don't really know what the impact of that would be (if any?).

Since this one in particular causes a fatal, we could remove just this one in a point release. If we want to remove all of them we should probably do that in a major.

@robincornett
Copy link
Contributor

It seems like we could theoretically remove them all in 3.0, based on the instructions in the developer handbook:

Since WordPress 4.6 translations now take translate.wordpress.org as priority and so plugins that are translated via translate.wordpress.org do not necessary require load_plugin_textdomain() anymore. If you don’t want to add a load_plugin_textdomain() call to your plugin you have to set the Requires at least: field in your readme.txt to 4.6 or more.

The handbook does say to use the load_textdomain_mofile hook if you want to load your own translation, and it looks like we do that, based on a text domain change in EDD 2.4.6, but I wonder if we would still need to support that in 3.0.

@robincornett
Copy link
Contributor

Reopening as the test_included_languages function needs to be updated to account for the change in included language files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment