• Resolved johannesdb

    (@johannesdb)


    So, I updated to the latest version of WPML and WPML String Translation and Woocommerce and a strange thing happened: When I view a translated page when logged in as admin, the page breaks. I get an error:

    There has been a critical error on this website.

    But nothing in the logs or nothing when I enable debug in wp-config. The page just tries to load but seems to stall – and then the error.

    If I disable WPML String Translation, it works.

    If I disable Woocommerce, it works.

    If WooCommerce and string translation is active = site breaks…

    I have no idea where to start to debug this in your plugin. I assume the bug is in your plugin as the site works, when I am not logged in as admin and therefor can’t see the view as-features.

    I can give you access to the site, if you want. Just mail me at johannes@udstillerguide.dk

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @johannesdb

    When there is a critical error there must be a PHP error you should be able to see. Did you check your wp config for a WP_DEBUG_DISPLAY constant?

    Without an error I have no clue where to start.

    One think that I can think of is that you could be on a page where the current view (admin) isn’t allowed to be?

    When using a role view this plugin only changes your role, and therefore your capabilities, it doesn’t really do anything else.

    Please try to get the error to show so I have some idea where what it might be.

    Cheers, Jory

    Thread Starter johannesdb

    (@johannesdb)

    HI @keraweb,

    thanks for the fast answer! It seems to be something that uses a lot of memory – so the site ran out of memory! I raised the limit to 2048MB and the site now throws two fatal errors in the log:

    [17-Aug-2023 11:44:57 UTC] PHP Fatal error: apply_filters(): Cannot use output buffering in output buffering display handlers in /home/alfanova/test.udstillerguide.online/wp-includes/plugin.php on line 205

    [17-Aug-2023 11:45:37 UTC] PHP Fatal error: stream_get_contents(): Cannot use output buffering in output buffering display handlers in /home/alfanova/test.udstillerguide.online/wp-includes/pomo/streams.php on line 229

    Does that make more sense? I get the error when viewing the front page in English (translation) as admin. I have full access to the site an can the see the original language (danish) with out any issues.

    Thread Starter johannesdb

    (@johannesdb)

    But to be honest, I am not sure the your plugin is the culprit. But when I disable your plugin – no more error. If I view the page when not logged in – no more error.

    But if you have an idea about where the bug could be if not in your plugin, please let me know 🙂

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @johannesdb

    Sorry for my late reply.
    The error you’ve posted seems to indicate that the output buffering is already in place so that would suggest that the order of actions/filters is incorrect.

    Are you able to create a screencast where you follow the exact steps and show the error? That way I can clearly see what you do exactly.

    And to be sure, you did test this with all other plugins deactivated?
    Please make sure this occurs if only WPML, Woo and this plugin are active on a default WP theme, none other. That way I can probably reproduce the issue.

    Cheers, Jory

    Thread Starter johannesdb

    (@johannesdb)

    Hi,

    no problem 🙂

    I made a recording here:

    on a site with only 4 active plugins and default theme:

    • view as admin
    • woocommerce
    • wpml
    • wpml string translation – this is the one I suspect

    If you want access to the site, just let me know 🙂
    johannes@udstillerguide.dk

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @johannesdb

    Thank you so much for the recording, this helps a lot to replicate your installation.

    I’ve installed the same plugins as you have but unfortunately still cannot reproduce this issue.
    Could you try to enable WP_DEBUG_DISPLAY and see if this results in any errors?

    Cheers, Jory

    Plugin Author Jory Hogeveen

    (@keraweb)

    For anyone visiting this topic with a similar issue.

    WPML String Translation added a .mo file which was corrupt (wp-content/languages/wpml/default-en_US.mo)
    We couldn’t find why this happened or what is included here as View Admin As doesn’t include any default core strings.

    Deleting the file fixes the issue. Closing topic for now!

    Cheers, Jory

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Strange error when logged in as admin’ is closed to new replies.