WordPress.org

Make WordPress Core

#39328 closed defect (bug) (fixed)

Adding terms without AJAX strips "taxonomy" query arg

Reported by: szaqal21 Owned by: peterwilsoncc
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.7
Component: Taxonomy Keywords: has-patch fixed-major commit
Focuses: Cc:

Description

I've wrote a plugin which disables AJAX for managment of taxonomy terms and I think I've found a bug. If I add new term for taxonomy "category", browser is being redirected to edit-tags.php widthout "taxonomy=category" arg. After some search in core I've found that redirect location is being set wrong - I think. Line 84 in edit-tags.php

<?php
$location = add_query_arg( 'message', 1, $location );

uses $location as url, shouldn't it be $referer as other actions do? $location at this point equals to false.

Attachments (1)

39328.diff (503 bytes) - added by peterwilsoncc 12 months ago.

Download all attachments as: .zip

Change History (6)

#1 @peterwilsoncc
12 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.7.1

I could reproduce this.

At first glance, looks like regression following [38750], putting on the 4.7.1 milestone for follow up.

#2 @peterwilsoncc
12 months ago

  • Keywords has-patch added; needs-patch removed
  • Owner set to peterwilsoncc
  • Status changed from new to accepted

Confirmed as a regression, 39328.diff uses fix suggested by szaqal21.

#3 @peterwilsoncc
12 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 39649:

Taxonomy: Redirect to current taxonomy when adding a term without AJAX.

Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21.
Fixes #39328 for trunk.

#4 @peterwilsoncc
12 months ago

  • Keywords fixed-major commit added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for back-porting to 4.7

#5 @dd32
12 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 39652:

Taxonomy: Redirect to current taxonomy when adding a term without AJAX.

Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21, peterwilsoncc.
Merges [39649] to the 4.7 branch.
Fixes #39328 for 4.7.

Note: See TracTickets for help on using tickets.