Support » Plugin: Magento 2 WordPress Integration » Fatal Error

  • Resolved essgee23

    (@essgee23)


    Hi, strange error:

    Got error ‘PHP message: PHP Parse error: syntax error, unexpected ‘else’ (T_ELSE) in /public_html/cms/wp-includes/l10n.php on line 259
    PHP message: PHP Fatal error: Uncaught Error: Call to undefined function __() in /public_html/cms/wp-includes/class-wp-locale.php:122
    Stack trace:\n#0 /public_html/cms/wp-includes/class-wp-locale.php(104): WP_Locale->init()
    #1 /public_html/cms/wp-includes/load.php(1222): WP_Locale->__construct()
    #2 /public_html/cms/wp-includes/class-wp-fatal-error-handler.php(161): wp_load_translations_early()
    #3 /public_html/cms/wp-includes/class-wp-fatal-error-handler.php(143): WP_Fatal_Error_Handler->display_default_error_template(Array)
    #4 /public_html/cms/wp-includes/class-wp-fatal-error-handler.php(50): WP_Fatal_Error_Handler->display_error_template(Array)
    #5 [internal function]: WP_Fatal_Error_Handler->handle()\n#6 {main}\n thrown in /public_html/cms/wp-i…\n’, referer: http://.de/cms/wp-admin/post.php?post=2&action=edit

    Any ideas? The code is guaranteed to be replaced correctly…

    function __( $text, $domain = 'default' ) {
        if ( defined( 'M2I_MAGE_DIR' ) && class_exists( 'M2I_External' ) && M2I_External::$needs_mage_translate ) {
            return M2I_External::translate( func_get_args() );
        } else {
            return translate( $text, $domain );
        }
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter essgee23

    (@essgee23)

    Magento (2.3.2) runs at root, WP is under /cms/. I am already using the Fishpig Integration but thought it would be great to have your integration additionally, to be able to include Magento stuff on the pages.

    Thread Starter essgee23

    (@essgee23)

    Sorry but is your plugin changing code in files automatically?

    After 1-2 admin requests, the I10n.php is broken because of this:

    if (!function_exists('__')) {
    	function __( $text, $domain = 'default' ) {
        if ( defined( 'M2I_MAGE_DIR' ) && class_exists( 'M2I_External' ) && M2I_External::$needs_mage_translate ) {
            return M2I_External::translate( func_get_args() );
        }
    }
    
     else {
            return translate( $text, $domain );
        }
    }
    Thread Starter essgee23

    (@essgee23)

    Sorry for spamming this thread, I solved it temporarily by chattr +i l10n.php.

    But this should not happen. A plugin should never change code in files without being asked for at least.

    Thread Starter essgee23

    (@essgee23)

    Forget about it, it was my fault xD

    Another plugin was making these changes.

    Plugin Contributor Yaroslav Yachmenov

    (@yaroslav0yachmenov)

    Hello,

    Yes, our plugin does not do any changes in WP core files. I’m happy that you have resolved this issue in your own.

    Kind regards,
    Yaroslav.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal Error’ is closed to new replies.