• Resolved Kermit524

    (@kermit524)


    [ Moved to the Fixing WordPress sub-forum. ]

    Hi All, would you please help me solve a mystery:
    Adding an action on “save_post” – with a callback function – when updating/adding a new post item – the screen turns empty blank.
    At start I thought there was a fatal error but turning on debug mode on wp-config.php – nothing comes out. Even worse – echoing a string before the callback function returns – would show the string echoed on the blank page.
    Apparently having the post item updated – the system would not redirect back to the post item editing screen.
    This happens (off-course) only on my production server. On my staging server everything goes smooth.
    any idea what may cause this?
    Many thanks in advance

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator t-p

    (@t-p)

    – Please check the error logs on your server for a more specific error message and see why it’s failing. If you need help locating them, ask your hosting provider to help you with that.
    – If you cannot find error logs or if you don’t find any helpful info in the error logs, try Enabling debugging

    Thread Starter Kermit524

    (@kermit524)

    Thanks so much for your reply! I just wonder if you took the time to actually read my message before replying. As I already wrote down in my original message – already enabled debug mode – no error message. Also – it’s clear that the script runs all the way because I could echo a string just before the call back function returns. I just hope this makes the issue more clear now. Thanks again for any help.

    Moderator t-p

    (@t-p)

    Have you checked server error logs for any clue?

    Thread Starter Kermit524

    (@kermit524)

    Yes. Nothing in there either.
    One more clue:
    Hitting submit on the post edit page, the page redirects to post.php (no querystring) – and there I stay, instead of being redirected to post.php?post=<ID>&action=edit.

    Thanks again!

    Moderator t-p

    (@t-p)

    Have you tried:
    – Flushing any caching plugins you might be running, as well as server and/or browser caches. Not just your browser, but any op cache or content network cache as well such as Cloudflare. If your host provider has a “Purge Varnish” option or if you can ask your provider to flush memcache on your server. If you are using SiteLock, manage your caching there.
    – deactivating ALL (yes all) plugins temporarily to see if this resolves the problem (plugin functions can interfere). If this works, re-activate them individually (one-by-one) to find the problematic plugin(s).
    – switching to the unedited default Theme (twenty seventeen) for a moment using the WP dashboard to rule out any theme-specific issue (theme functions can interfere like plugins).

    Thread Starter Kermit524

    (@kermit524)

    Thanks again for your reply!
    So going over your questions:
    – I have flushed and turned off all caches that I could think of – most of them were set by the host. I also went ahead and cleared the browser cache.
    – This is a production server, therefore – not really an option to deactivate plugins. I couldn’t duplicate the issue on a staging server :-\.
    – Same goes for switching to the default theme – no way for me to do it on a production server…
    Therefore I must find a way to debug this “under the radar”. Here are the things I already know:
    1. I can tell exactly when this happens: when I add a callback function on the post_save action.
    2. As I already mentioned – it looks like after hitting “update” on the post edit page, everything that’s in the post action is executed, but the page does not redirect back to the post edit page. So we are left with an empty white screen.
    3. There is no error message or any runtime error – even when I turn on debug mode. Nothing on the screen and nothing on the logs.
    I was trying to google “page is not redirecting after post update, blank screen at post update etc..” but couldn’t get anything.
    Thanks again!

    Thread Starter Kermit524

    (@kermit524)

    Update: the problem is resolved and the solution was satanically simple: I had a ‘space’ character printed out before the php opening tag on my script file. That was sent as header so no other headers could be sent, and therefore the script stopped before redirection. Indeed it printed a warning – but it was not displayed due to security settings on the server, and I got left with a blank page. What is still a mystery is how come it did work on my staging server, but anyway, it is resolved now.

    Moderator t-p

    (@t-p)

    Glad to know it ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘White screen with no error on updating post’ is closed to new replies.