Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter mateuszn

    (@mateuszn)

    @chesio
    Hi, thanks for your tips. In fact that is what we actually do: we have some menus in Polish (linking Polish pages) and corresponding English menus for English pages. And we do not use Polylang translation system (at least in menus).

    Thread Starter mateuszn

    (@mateuszn)

    @chrystl
    No luck with displaying all variables – script:

    Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate YYY bytes)

    However I have managed to find a page that displays content of $_SERVER only:

    https://lectorium.edu.pl/pl/?debug-this=server prints [PHP_SELF] => /pl/

    https://lectorium.edu.pl/en/?debug-this=server prints [PHP_SELF] => /en/

    Plugin Support Chrystl

    (@chrystl)

    Thanks, it helps a lot.
    Now could you go to Debug this > Server > $_SERVER ?
    Check if the line [SCRIPT_NAME] contains index.php.

    If this is the case, could you replace in polylang/frontend/choose-lang.php at line 35 ‘PHP_SELF’ by ‘SCRIPT_NAME’ ?

    Thread Starter mateuszn

    (@mateuszn)

    (I do not know why, but some of my replies do not reach you… Probably some kind of spam-filtering). Nevertheless, the things you asked for:

    https://lectorium.edu.pl/en/?debug-this=server: [SCRIPT_NAME] => /en/ and [SCRIPT_FILENAME] => /srv/www/wordpress/lectorium/index.php

    https://lectorium.edu.pl/pl/?debug-this=server: [SCRIPT_NAME] => /pl/ and [SCRIPT_FILENAME] => /srv/www/wordpress/lectorium/index.php

    Would you like me to replace L35 with SCRIPT_FILENAME?

    Plugin Support Chrystl

    (@chrystl)

    Would you like me to replace L35 with SCRIPT_FILENAME?

    Yes. Does it work?

    Thread Starter mateuszn

    (@mateuszn)

    Yes, it does ?? Thanks a lot.

    But I guess, I would have to replace that part each time I upgrade Polylang plugin. Am I right?

    Again, thank you very much. You have saved my day (or two) ??

    Plugin Author Chouby

    (@chouby)

    Hi!

    @chrystl informed me about this issue. I replaced SCRIPT_FILENAME by PHP_SELF in v1.8. However your issue as well as further investigations demonstrate that this is not a reliable variable. Another user reported a WordPress bug due to this unreliable PHP_SELF. See #34634

    I am not sure that SCRIPT_FILENAME is more reliable, but since it’s what I used in the past, I will revert to it in the next version. You won’t have to modify the code each time you upgrade Polylang ??

    Thread Starter mateuszn

    (@mateuszn)

    That’s great news! Thanks

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Does not get language from contents’ is closed to new replies.