SOLVED: 'Invalid post type' using 'edit template' link from within editor

WP 6.5.2
Bricks 1.9.7.1

I’ve scoured the forums, but nothing suggested seems relevant or solves my issue.

I’ve added a section template to a page using the Template element. Though I’m using a section template, this happens for all templates inserted via the Template element. The edit links from Bricks > Templates are fine—it’s purely a problem with the in-editor links. To add to the mystery, this seems intermittent in some way. A Template element on a page that wasn’t working previously, is now working, but one on another page isn’t. 90-95%+ it doesn’t work.

image

Things that haven’t worked:

  • Resaving permalinks (repeatedly, and after other actions)
  • switching from child theme to Bricks
  • disabling all plugins
  • host has no rewrite rules for environment

I do have the Redirection (5.4.2) and Permalinks Manager Lite (2.4.3.2) plugins installed as well, but disabling all plugins didn’t resolve the issue.

Separately I spun up a new environment on Local, and I wasn’t able to replicate this. I initially thought that the permalink structure was a problem, as there is clearly a redirect happening to translate https://site.com/?p=6804&bricks=run to https://site.com/template/my-template-name/?bricks=run, but that didn’t seem to be a problem on the fresh Local site. I’m very puzzled by this, because I can’t figure out how long this has been happening—it was working fine at one point (a few months ago?), but now it’s not.

Hi Jon,
Thanks so much for your report!

What is your permalink structure set to? Unfortunately, I cannot reproduce the problem.

Please send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase.

Best regards,
timmse

Thanks! Email sent.

Permalink structure is “Post name”. Nothing custom.

Bricks support was able to track down the issue to my child theme, and I found the filter function that was interfering. The filter was tweaking fuzzy URL matching behavior. I’ve modified the function, and it appears to be working as expected. What is weird is that that function has been in the child theme for a long time (long enough that I forgot it was in there), and it hadn’t interfered previously. I’m not sure if some other underlying behavior changed about WP core or some other plugin modified how that was being handled.

We can close this out. Thank you!

1 Like