Posted: August 25, 2020 at 12:39 am
We’ve been using EE4 and from time to time the issue of displaying the event page comes up. This issue comes and goes without any intervention from page admins…
The main page displaying all events work fine but when you click to see details of a particular event, the page goes to “Oops, the page you’re looking for is no longer here…”. This issue happens to all events, regardless of their status (upcoming, active, inactive, past)…
There is nothing in the backend that our developer can figure out. The problem tends to happen unexpectedly, sometimes for a few hrs at a time and then everything works again after…
Has this happen to anyone else using EE4? We previously used EE3 and never had this issue, is this a known issue with the upgrade version?
It sounds like permalinks are being flushed at an unexpected time which means EE hasn’t added it’s rewrite rules, then a little later it’s happening on a different request and at that point, EE has added the rewrite rules.
We’ve seen the first part of the above happen before but couldn’t reproduce to narrow down the cause further. The fact that your site ‘fixes’ itself a little later is odd but still points to permalinks.
When you say the ‘main page’, is that the /events/ output or another page using
It’s hard to give you a solution for this without more detila sbut I can give you the steps I would take to narrow this down.
First, enable WP_DEBUG but set it to only log errors using this:
That tells your site to write all logs to /wp-content/debug.log
Then add this to your site: https://gist.github.com/Pebblo/a6d2b949d0ae784c09de442b9848ff7d
It’s a plugin that writes the rewrite rules to the log file each time permalinks are flushed with a stack trace for what called the flush.
The problem with the above is you then need to wait until it happens again and go through that log file to see when the permalinks are flushed, it doesn’t fix anything as is.
There is one request in which we known the rewrite rules are not added and it’s for the wp-login request as intentionally doesn’t run on those requests, however, you can add this snippet:
Whish tells EE to continue to load there, which may or may not solve the problem.
Thanks for the quick response…
Yes we use [ESPRESSO_EVENTS] short code to display events on our webpage. They actually load fine, the error message only pops up when you click on the event to see its details – which directs to the event link. The same is experienced if I access the “view” option from the event edit window.
It does sound like it’s related to page “links”… we’ll look into permalinks and the steps you’ve suggested to find out more…
Yeah that would be ‘expected’ in that case,
It will actually work if you change it to use
The first snippet I gave you logs the flush permalinks call and has a simple check to confirm if the /events/ endpoint is saved. So to confirm it’s working add that plugin and go to Dashboard -> Settings -> Permalinks, click save.
Then on your site go to /wp-content/debug.log and check the output, the rewrite ruleslogged should have the events slug set and EE_Check should be