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.