Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#20086 closed defect (bug) (fixed)

Javascript error when submitting an existing taxonomy

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

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 14 years ago.

Download all attachments as: .zip

Change History (4)

#1 @nacin
14 years ago

  • Component GeneralTaxonomy
  • Milestone Awaiting Review3.4

@solarissmoke
14 years ago

#2 @solarissmoke
14 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_
14 years ago

  • Owner set to duck_
  • Resolutionfixed
  • Status newclosed

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.