soflyy/oxygen-bugs-and-features

Oxygen meta box doesn't recognize Inner Content of manually-assigned template when the default template for the post doesn't include Inner Content

Opened this issue · 1 comments

With the following templates:

  • "Main" - Assigned as catchall, priority 0, contains header, footer, and inner content.
  • "Default for Pages" - Assigned to "page" post type, priority 0, inherits "Main", does not include inner content (i.e., because all content comes from custom fields.)

With that setup, new pages will be automatically assigned to use the template "Default for Pages," in which case direct editing of the post through Oxygen should not be possible since that template doesn't include an Inner Content.

However, "Main" can be assigned manually if desired for the post, and in that case, direct editing through Oxygen SHOULD be possible since "Main" DOES include Inner Content.

Instead, the Oxygen meta box only includes a link to edit the Template, even if "Main" (with the Inner Content element) is selected to render the post.

It appears the meta box "Edit with Oxygen" button only checks to see if the default template for the post includes Inner Content, rather than checking the template that is actually assigned to the post.

It is possible to edit the post through Oxygen by clicking the "Edit with Oxygen" link on the post listing page; only the meta box appears to be affected.

Here is a link to a page on a sandbox site that shows the issue:
https://oxygen-qsychc8xtbkxl.oxygen-demo.qsandbox.org/wp-admin/post.php?post=20&action=edit

Replicated and reported internally via https://github.com/soflyy/oxygen/issues/5280