Ticket #6343 (closed defect (bug): fixed)

Opened 10 months ago

Last modified 10 months ago

Adding custom field: wording and behaviour

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

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

6343.diff (9.0 kB) - added by mdawaffe on 03/22/08 06:59:02.
6343.2.diff (0.5 kB) - added by DD32 on 03/25/08 01:24:59.

Change History

03/21/08 23:28:15 changed by ryan

  • keywords set to AJAX.
  • owner changed from anonymous to mdawaffe.
  • milestone changed from 2.7 to 2.5.

Looks like the Add Custom Field AJAX is busted.

03/22/08 01:01:28 changed by mdawaffe

  • status changed from new to assigned.

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

03/22/08 06:59:02 changed by mdawaffe

  • attachment 6343.diff added.

03/22/08 07:02:09 changed by mdawaffe

  • keywords changed from AJAX to AJAX has-patch needs-testing.

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
    

03/22/08 08:15:14 changed by ryan

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.

03/22/08 08:15:48 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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

03/25/08 01:23:29 changed by DD32

  • status changed from closed to reopened.
  • resolution deleted.

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

03/25/08 01:24:59 changed by DD32

  • attachment 6343.2.diff added.

03/25/08 01:42:39 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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