Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    What is the exact error message?

    Thanks! ??

    Thread Starter emembrillas

    (@emembrillas)

    Undefined array key 1
    wp-content/plugins/gtranslate/gtranslate.php:2033

    Plugin Author edo888

    (@edo888)

    Hi,

    This is the line:

    @list($request_uri, $query_params) = explode('?', $_SERVER['REQUEST_URI']);

    It has @ to suppress the errors if the URL does not have ? inside. If you have some special error handler configured, then you will need to check it and make sure it does not cause issues, as this is totally OK.

    Thanks! ??

    Thread Starter emembrillas

    (@emembrillas)

    The error is marked by query monitor, but even if I don’t have it activated and having the “define (‘WP_DEBUG’, true)” activated, I get a white space in the wordpress administrator, because a “php-error” class is inserted in the body, and I understand that it is due to that specific error, because if there is a “?” this does not happen in the url.

    Plugin Author edo888

    (@edo888)

    You will need to check it with your system administrator, as I have mentioned it seems that you have a special error handler configured which does not respect @ to suppress warnings and it generates an error instead.

    Alternatively you can rewrite that line to account the case when ? is not present in the code, but in that case you will need to do that every time. We might consider adding it in our future releases. Something like this should do the trick:

    
    $url_params = explode('?', $_SERVER['REQUEST_URI']);
    $request_uri = $url_params[0];
    if(isset($url_params[1]))
        $query_params = $url_params[1];
    else
        $query_params = '';
    

    Thanks! ??

    Thread Starter emembrillas

    (@emembrillas)

    Correct, with that code the error is fixed. The error may be due to the new version of PHP8.

    Thx!

    • This reply was modified 4 years, 2 months ago by emembrillas.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Error in Line wp-content/plugins/gtranslate/gtranslate.php:2033’ is closed to new replies.