Ticket #3700 (new defect (bug))

Opened 2 years ago

Last modified 8 months ago

Adding a custom field to an unsaved Page before publishing causes weirdness

Reported by: markjaquith Assigned to: Andy
Priority: normal Milestone: 2.9
Component: Administration Version: 2.3.2
Severity: normal Keywords: needs-patch
Cc: guillep2k

Description (Last modified by markjaquith)

As reported on my blog by "Kira":


  1. I start a new page and give it a title of “Forum” without the quotes, leaving the page content blank;
  2. I add a links_to custom field with a value of “http://www.kalunite.net/forum/” without the quotes;
  3. Click “Publish”;

The newly created page is not listed among the Pages; instead, it is saved as a post draft by WordPress. Furthermore, the title is “Draft created on January 27, 2007 at 10:51 am” instead of “Forum”.


More generically:

  1. Click "Write > Page"
  2. Move quickly for the next few steps
  3. Add a title (optional: content)
  4. Add a custom field key/value pair (click "Add Custom Field" after typing it in)
  5. Click "Publish"

What happens is that adding the custom field creates the Page as a POST draft, with a "Draft created on DATE at TIME" title. You have to move quickly because autosave appears to rectify this. clicking Publish does nothing, and your page seems to disappear (it has become a page draft).

Bit of an edge case, but still a valid bug.

Attachments

add_meta_post_type.diff (2.3 kB) - added by markjaquith on 01/28/07 04:39:55.

Change History

01/28/07 03:54:23 changed by markjaquith

  • description changed.

Note: you must click "Add Custom Field" after filling in the custom field info

01/28/07 04:39:55 changed by markjaquith

  • attachment add_meta_post_type.diff added.

01/28/07 04:47:04 changed by markjaquith

  • owner changed from anonymous to Andy.
  • version set to 2.1.

Okay, add_meta_post_type.diff helps passes along the post_type with the meta-add AJAX action and puts that into the post_type when creating the temporary post...

BUT... nothing happens when clicking Publish (i.e. it is left as a Page Draft with the draft title), so something else is missing.

Andy, Mike A... help!

01/30/07 01:15:59 changed by charleshooper

I tested your patch using 2.2-bleeding and the default theme. It works fine for me, didn't see any JS errors thrown up or anything either.

01/30/07 10:57:04 changed by markjaquith

Yes, but it doesn't quite fix the problem. The page isn't published, and its contents aren't saved. All it does is prevent it from turning into a POST draft.

02/21/07 15:39:21 changed by Nazgul

  • milestone changed from 2.1.1 to 2.1.2.

03/28/07 00:57:09 changed by foolswisdom

  • milestone changed from 2.1.3 to 2.3.

(in reply to: ↑ description ) 05/09/07 13:03:10 changed by doodlebee

  • version changed from 2.1 to 2.1.3.

I would like to say that I have this same bug appearing on my site. I'm running 2.1.3. I'll run through my steps:

1) Write Page 2) Enter title 3) enter content 4) uncheck "allow comments" and "allow pings" 5) set "Page status" to "Published" 6) scroll down, add custom field (whether or not I've already created it, I enter the values here) 7) click "Apply Custom Field" 8) scroll back up, hit "Publish" 9) the new Page does NOT appear in the "Pages" list. Instead, it shows up in the "Posts" list. Shows up as "Unpublished", title is changed to "Draft created on [date] at [time]"

Now, if I create the Page *without* a custom value, I have no problem. It'll save as a Page, and then I can go back in and add the custom field and everything is fine. But it sure adds some unnecessary steps.

05/12/07 13:22:21 changed by Nazgul

Also reported in #4250

09/22/07 07:30:28 changed by Nazgul

  • keywords set to needs-patch.
  • milestone changed from 2.3 to 2.4.

11/06/07 16:20:38 changed by foolswisdom

Also reported in #5323

11/09/07 23:42:15 changed by lloydbudd

Also reported in #5333 .

01/28/08 01:48:43 changed by doodlebee

  • version changed from 2.1.3 to 2.3.2.

I'd like to add this to posts now. I'm running WordPress 2.3.2, and have a custom fields system set up for a client. Our system is:

1) types in post title, post content, selects category 2) scrolls down and adds custom field information, hits "Add Custom Field". Nothing happens, but apparently the field is added (I'm used to seeing it show up somewhere when you add it - but it never does.) 3) Publish post.

what I *expect* is to the post is published. What happens is the post is saved as "Draft created on (whatever date) at (whatever time)" - all post data entered is lost.

As with the rest 0if I write the post and publish, then return to it and add the custom field, it's fine. Annoying to have to do this every time, though.

05/06/08 10:56:20 changed by guillep2k

  • cc set to guillep2k.

This bug looks related to #6457.

05/28/08 11:18:11 changed by felipelavinz

  • cc deleted.

Custom fields cause "publishing weirdness" on Pages even if you don't move quickly (as initially reported on this bug)... I've been working with Pages and custom fields on 2.5.1 and even with the trunk svn checkout, and everytime I try to add a custom field to a page I'm redirected to some other place... if, in fact, I go really quickly, before the auto-saving acts, clicking on "Add Custom Field" takes me to Write > Page, but none of the info I just entered it's there and I can't find that page anywhere... if I go slow and the page it's auto-saved before I add the new custom field, I get to Write > Page again, not to the Page I was editing, so I have to go to Manage > Pages and try to find it... The only "solution" I've found it's to write the info of the custom field and then, instead of clicking on "Add Custom Field", just click on "Save"... this, at least, works, but it feels totally primitive without the AJAX fireworks.

Maybe this should have a higher priority/severity level, since it leads to unpleasant loss of work... just my opinion

05/28/08 11:48:55 changed by guillep2k

  • cc set to guillep2k.