Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#6343 closed defect (bug) (fixed)

Adding custom field: wording and behaviour

Reported by: versuchsanstalt Owned by: mdawaffe
Priority: normal Milestone: 2.5
Component: Administration Version: 2.5
Severity: normal Keywords: AJAX has-patch needs-testing
Cc: Focuses:

Description

Adding custom fields has changed with 2.5rc1.

It seems impossible now to add more than one custom field before saving the post.

Clicking "Add Custom Field" does NOT (only) what the button says, but will also save the post. Either the wording is wrong or the behaviour.

Please bring back the 2.3.3 behaviour. I am developing a site where every post is just one or two sentences and two, sometimes three custom fields. It used to take about 20-30 seconds to write a post using 2.3.3, now its turning into a clickfest.

One or two more form elements for adding custom fields would also solve my problem, but the old way to do it used to be far better than that. I am considering to stay with 2.3.3.

Attachments (2)

6343.diff​ (9.0 KB ) - added by mdawaffe 19 years ago.
6343.2.diff​ (551 bytes ) - added by DD32 19 years ago.

Download all attachments as: .zip

Change History (9)

#1 @ryan
19 years ago

  • Keywords AJAX added
  • Milestone 2.7 → 2.5
  • Owner changed from anonymous to mdawaffe

Looks like the Add Custom Field AJAX is busted.

#2 @mdawaffe
19 years ago

  • Status new → assigned

I'll have a patch for this by Saturday afternoon PST.

@mdawaffe
19 years ago

#3 @mdawaffe
19 years ago

  • Keywords has-patch needs-testing added

6343.diff

  1. Fixes custom field add/update/delete.
  2. Uses autosave functions after adding a custom field to a never-before-saved post to update post id.
  3. Fixes strange wp-lists animation bug.
    jQuery( ... ).stop(); // doesn't work
    jQuery( ... ).stop().stop(); // does
    

#4 @ryan
19 years ago

Working well here. I notice that after adding a meta key to a new post, if you add title text and then change focus to another field the autosave on title blur doesn't kick in. Not a big deal.

#5 @ryan
19 years ago

  • Resolution → fixed
  • Status assigned → closed

(In [7468]) Fix custom field add/update/delete. Props mdawaffe. fixes #6343

#6 @DD32
19 years ago

  • Resolution fixed
  • Status closed → reopened

Adding new meta keys when no meta keys currently exist is broken after the commit.

Upon clicking add, I get several PHP errors, To me, it looks like its not taking the correct branch.

Heres the post data:

array
  '_ajax_nonce' => string '92ea72e0e5' (length=10)
  'action' => string 'add-meta' (length=8)
  'post_id' => string '136' (length=3)
  'metakeyinput' => string 'testkey' (length=7)
  'metavalue' => string 'testvalue' (length=9)

I'll attach a patch for what seems to be the correct behaviour & is working for me

@DD32
19 years ago

#7 @ryan
19 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [7509]) Fix addition of new meta keys when no meta keys currently exist. Props DD32. fixes #6343

Note: See TracTickets for help on using tickets.