WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 months ago

Last modified 4 months ago

#27556 closed defect (bug) (wontfix)

Saving a post doesn't notify a user if the post has been correctly saved

Reported by: frosso Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Posts, Post Types Keywords: needs-patch bulk-reopened
Focuses: administration Cc:

Description

I had a post with a custom template attached to it.
Then we disabled users ability to assign custom templates.
Then we deleted the custom template from the filesystem.
Every time we tried to save the post with the non-existing template, wordpress notified us that the post was correctly saved, but it actually failed saving all the meta boxes inputs.

Change History (8)

#1 @frosso
5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

I found someone with a similar issue #17115

#2 @SergeyBiryukov
5 years ago

Your issue sounds different from #17115.

#3 @SergeyBiryukov
5 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

#4 @frosso
5 years ago

Yeah, but debugging a bit I found out it was due to line 2943 in wp-includes/post.php, the condition

'default' != $page_template && ! isset( $page_templates[ $page_template ] )

returns true (since the template is not 'default').

#5 follow-up: @SergeyBiryukov
5 years ago

I had a post with a custom template attached to it.

Did you mean a page or a custom post type? Custom templates are currently only available for pages, see #18375.

Then we disabled users ability to assign custom templates.

How exactly did you do that?

The Template dropdown in Page Attributes meta box doesn't seem to be controlled by a user capability, only by the actual presence of custom templates: tags/3.8.1/src/wp-admin/includes/meta-boxes.php#L659.

The meta box, however, depends on whether the post type supports page-attributes:
tags/3.8.1/src/wp-admin/edit-form-advanced.php#L163.

#6 in reply to: ↑ 5 @frosso
5 years ago

Replying to SergeyBiryukov:

I had a post with a custom template attached to it.

Did you mean a page or a custom post type? Custom templates are currently only available for pages, see #18375.

Yes, I meant a page, sorry for the confusion

Then we disabled users ability to assign custom templates.

How exactly did you do that?

The Template dropdown in Page Attributes meta box doesn't seem to be controlled by a user capability, only by the actual presence of custom templates: tags/3.8.1/src/wp-admin/includes/meta-boxes.php#L659.

The meta box, however, depends on whether the post type supports page-attributes:
tags/3.8.1/src/wp-admin/edit-form-advanced.php#L163.

By using this function call on the 'init' action

remove_post_type_support( 'page', 'page-attributes' );

#7 @chriscct7
4 years ago

  • Keywords needs-patch added

#10 @Mista-Flo
5 months ago

  • Keywords bulk-reopened added
  • Resolution set to wontfix
  • Status changed from reopened to closed

I think it's an edge case, I'm not sure what we can do on it.

Note: See TracTickets for help on using tickets.