Ticket #7541 (new defect (bug))

Opened 5 months ago

Last modified 6 days ago

Adding a custom field without a value gives unidentified error.

Reported by: hedgepig Assigned to:
Priority: low Milestone: 2.8
Component: Administration Version: 2.7
Severity: minor Keywords: needs-patch
Cc:

Description

On a fresh install...

If you create post1 and add several custom fields of the format 'name'=>'url' everything works fine.

BUT...

If you create post2 (with a title) and try and add one of the custom fields that we previously already defined, then you get the error 'An unidentified error has occurred.'

If you create post2 without a title and add one of the previously defined fields then it adds it, but the name and value are blank.

Attachments

fields copy.jpg (68.9 kB) - added by mrmist on 09/15/08 19:56:46.
Showing error box
blanks.jpg (62.9 kB) - added by mrmist on 09/15/08 20:01:37.
Blank boxes

Change History

08/18/08 21:48:12 changed by mrmist

Confirming. Applies to ALL custom fields from what I can tell.

Also in 2.7-bleeding. (8665)

09/14/08 21:22:22 changed by azaozz

  • keywords changed from admin, bug, custom to reporter-feedback.

Can't reproduce in trunk [8889]. Fields seem to work properly. Could have been js/ajax error because of cached js files. Can you re-test again?

09/15/08 17:06:24 changed by jacobsantos

Can't reproduce either.

09/15/08 19:56:12 changed by mrmist

I can still reproduce this with 8895.

The first time I tried it I had absolutely nothing happen. The second (new post) produced the error. Attached example of error.

09/15/08 19:56:46 changed by mrmist

  • attachment fields copy.jpg added.

Showing error box

09/15/08 20:01:14 changed by mrmist

For info this is IE 7 for me.

Also I can produce a slightly different error by doing new post and then attempting to add a custom field from the pull-downs without making any other changes on the new post screen - in this event a series of blank boxes is added. (shown in blanks attachment.)

09/15/08 20:01:37 changed by mrmist

  • attachment blanks.jpg added.

Blank boxes

09/15/08 20:04:42 changed by mrmist

Same thing in Opera, which I guess excludes cached scripts, too.

09/15/08 20:21:55 changed by azaozz

Re-tested in FF, Safari, Opera and IE, all seems to work well. Are there any js errors in Opera? Do the rest of the AJAX functions work well? Any over-jealous firewall/antivirus installed?

09/15/08 20:53:45 changed by mrmist

No to firewalls/AV. (Actually no AV installed here just now ..)

Not sure what the best way to test other functionality is. Pretty much everything seems to work apart from these custom fields.

No (javascript) errors appear in Opera / IE, you just get the red box.

I don't run a lot of plugins on the svn test but I disabled them all for good measure, still get the same results. It's an odd one.

Incidentally I don't use custom fields. But this would be a pain if I did. I can reproduce the same behaviour on my prod site, which is a different server, apache, and PHP version.

In all events, manually adding a custom field by writing in the name - value pair always works, only the pull-down doesn't.

What is the correct behaviour? When you select from the pull-down is the name value pair supposed to be auto-completed or is it meant to be left blank? 'cos on these they remain blank.

09/15/08 21:28:25 changed by jacobsantos

  • priority changed from highest omg bbq to high.

For the dropdown, the value should be filled in and the name should be blank. When not using the dropdown, the name should be filled and the value should not be blank.

09/15/08 21:32:37 changed by jacobsantos

I was able to reproduce.

  1. Create new post.
  2. Enter title.
  3. Save Draft -> (if you don't save draft the custom field won't show up until you save the draft, might be regression or bug).
  4. Enter dropdown for custom field or enter name.
  5. Click "Add Custom Field"

The error "An unidentified error has occurred." will show up below the boxes. This should probably say, "Please enter value for the custom field before adding."

This is probably invalided in the current wording, but a patch should be made to improve the experience.

09/15/08 22:00:23 changed by azaozz

  • keywords changed from reporter-feedback to needs-patch.
  • priority changed from high to normal.
  • severity changed from major to normal.

Actually the whole postbox is quite unintuitive. The select should only be available at first and have an option "-Type Name-" or similar. When selected it should let you type the field's name.

The Add Custom Field button should be disabled until both name and value are not empty.

10/15/08 04:12:06 changed by jacobsantos

  • owner changed from anonymous to jacobsantos.
  • milestone changed from 2.7 to 2.8.

Pushing to 2.8, doesn't appear anyone is willing to do this for 2.7.

10/15/08 04:12:18 changed by jacobsantos

  • priority changed from normal to low.
  • severity changed from normal to minor.

10/23/08 01:20:16 changed by jacobsantos

  • owner deleted.

12/11/08 03:42:48 changed by vladimir_kolesnikov

  • keywords changed from needs-patch to reporter-feedback needs-patch.

Can't reproduce this in WP 2.7. Does this bug still persist for you?

12/11/08 18:47:51 changed by mrmist

Yes, it persists in 2.7 and through to 2.8-bleeding 10191.

However, it now only appears for me when attempting to add existing custom fields using the dropdown. It will happily create a new one via the text box.

01/03/09 16:39:16 changed by mrmist

  • keywords changed from reporter-feedback needs-patch to needs-patch.
  • version changed from 2.6.1 to 2.7.
  • summary changed from 2.6.1 Bug with custom fields to Adding a custom field without a value gives unidentified error..

Finally pinned this one down - it happens when you attempt to add a custom field name without filling in the value box.

A better error would be "You must supply a value". Either that or it should let you add a name without a value - since once a name value pair is present you can edit the value and leave it blank.