• Resolved dchloros

    (@dchloros)


    Hello,

    I am experiencing a critical error when trying to access the LearnPress plugin’s translation interface in Loco Translate.

    The specific error message from my debug.log is:

    PHP Fatal error: Declaration of ArrayIterator::getArrayCopy() must be compatible with LocoArrayInterface::getArrayCopy(): array in /wp-content/plugins/loco-translate/lib/compiled/gettext.php on line 0

    My website details are:

    • WordPress Version: 6.6.2
    • PHP Version: 8.0
    • Loco Translate Version: Έκδοση 2.7.3 

    I have already tried the following troubleshooting steps:

    1. Updated Loco Translate to the latest available version.
    2. Deactivated and then reinstalled Loco Translate.

    The issue persists, and I am unable to access the LearnPress translation files. I would prefer not to downgrade my PHP version if possible.

    Could you please provide assistance with this compatibility issue?

    Thank you for your time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Thanks for reporting. I’ll look at fixing this ASAP.

    Plugin Author Tim W

    (@timwhitlock)

    This is fixed in the dev version. The next release will include this fix.

    If you don’t want to install the dev version and you can’t wait for the next release then you can manually patch the gettext.php file. Just remove the return type declaration on line 7 so that getArrayCopy():array; becomes just getArrayCopy();

    Plugin Author Tim W

    (@timwhitlock)

    Alternatively, roll back to 2.7.2.

    The 2.7.3 release doesn’t include any changes you will benefit from under PHP 8.0.

    Plugin Author Tim W

    (@timwhitlock)

    Alternatively, roll back to 2.7.2.

    The Advanced View of the WordPress plugin page provides all historical versions for download.

    Alternatively, you can manage your installed version manually using Git tags.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal Error: Loco Translate incompatibility with PHP 8.0 and ArrayIterator’ is closed to new replies.