Closed nickcernis closed 9 years ago
I confirmed this earlier this morning and verified the fix. @nathanrice
Perhaps instead of, “Nice try, partner. But that taxonomy doesn't exist. Click back and try again.”, simply: “Sorry, but that taxonomy could not be deleted.”
I'm fairly sure that's a core WP message.
I'm fairly sure that's a core WP message.
It is. I missed that Nick suggested a change there.
No! I'm wrong - https://github.com/copyblogger/agentpress-listings/blob/c01ba501765adaa9cdc17dcaf5be9be0928d47fb/includes/views/edit-tax.php#L7 https://github.com/copyblogger/agentpress-listings/blob/c01ba501765adaa9cdc17dcaf5be9be0928d47fb/includes/class-taxonomies.php#L150
Modeled after an old core message (I think)
@rrennick @dreamwhisper Yeah, I thought it sounded very WordPress-ish at first, (Howdy, partner!), but then found it's something we could change in class-taxonomies.php.
Not a big deal, and my PR doesn't include a change for that, but thought I'd mention it nevertheless.
this can be tested.
To test
Confirmed x3 with support staff.
To reproduce:
You’ll see that the edited taxonomy has a blank ID, and that the old unedited version is still present:
The following two error messages are generated when the taxonomy is edited:
[28-Dec-2014 23:29:52 UTC] PHP Notice: Undefined variable: id in /vagrant/wp/wp-content/plugins/agentpress-listings/includes/class-taxonomies.php on line 200
[28-Dec-2014 23:29:52 UTC] PHP Notice: Undefined variable: id in /vagrant/wp/wp-content/plugins/agentpress-listings/includes/class-taxonomies.php on line 204
Attempting to delete the taxonomy results in a ‘nice try, partner’ message.
Modifying the
edit_taxonomy()
method in class_taxonomies.php to define$id
before using it on line 197 appears to fix the issue (fix included in PR#15):Additionally, maybe it would be worth changing the message that people see upon attempting to delete a taxonomy with no ID, so that it sounds less accusatory/confusing? (We had a complaint about this.)
Perhaps instead of, “Nice try, partner. But that taxonomy doesn't exist. Click back and try again.”, simply: “Sorry, but that taxonomy could not be deleted.”