Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20086 closed defect (bug) (fixed)

Javascript error when submitting an existing taxonomy

Reported by: themefusecom's profile ThemeFuse.com Owned by: duck_'s profile duck_
Milestone: 3.4 Priority: normal
Severity: minor Version:
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

When trying to add an existing taxonomy, a javascript error occurs: "Uncaught TypeError: Cannot read property 'supplemental' of undefined"

This is because the script will continue to try and add the taxonomy inside the select tag (inside the #addtag form), without checking whether the taxonomy is not null.

Solution: In tags.dev.js, on line 54, you need to check whether res.responses[1] is not null.

Attachments (1)

20086.diff (396 bytes) - added by solarissmoke 12 years ago.

Download all attachments as: .zip

Change History (4)

#1 @nacin
12 years ago

  • Component changed from General to Taxonomy
  • Milestone changed from Awaiting Review to 3.4

@solarissmoke
12 years ago

#2 @solarissmoke
12 years ago

  • Keywords has-patch added; needs-patch removed

I think it may be better to do a generic check for errors and if they exist, stop trying to process the response. The error message will have already been displayed by then.

#3 @duck_
12 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [20086]:

Bail from AJAX success callback if wp_ajax_add_tag() returns errors. Props solarissmoke. Fixes #20086.

Note: See TracTickets for help on using tickets.