Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
taxonomy.module
Priority:
Minor
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
2 Dec 2011 at 21:25 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pwolanin commentedEasy fix - set the last page argument as NULL
Comment #2
pwolanin commentedComment #4
pwolanin commentedoops guess I missed the memo about the core/ patch going in :(
Comment #5
pwolanin commentedComment #8
pwolanin commentedHmm, keep messing up the prefix. Let's try this.
Comment #9
ksenzeeAt first I was a little unclear on why this was necessary, but eventually I figured out it's because taxonomy_form_term() takes two arguments past $form and $form_state - one for the term, the other for the vocabulary. The menu router entry should specify both those arguments, but it currently only specifies the term.
Comment #10
catchThis should be easy to write a test for, also the menu entry could use a comment as to why we're specifying NULL there.
Comment #11
pwolanin commentedI don't understand what would be tested here - just that we don't provoke a notice with an extra path component?
Comment #12
catchYep.
Comment #13
xjmIt took me a few minutes to wrap my head around this as well. The extra argument it's expecting is the vocabulary machine name, for when the form builder is reused for:
admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/add(Added in #604980: taxonomy_term_edit() is useless.)
So despite that the argument for the function defaults to NULL, it has to be specified anyway in the menu hook to get around the feature that additional path components get passed in as additional args.
Edit: Never mind about that last bit; local environment problem. :P
Comment #14
xjmHere's a test for it. As a bonus, a message you don't see every day.

Comment #15
xjmOh, I missed where catch asked for a comment. Not sure how to say it concisely. How about:
Would that be sufficient? The API doc and signature for
taxonomy_form_term()should explain the rest.Comment #16
xjmIncorporating #15.
Comment #17
xjmActually maybe this is a bit more clear.
Comment #18
sunThanks, looks good.
(yet another reason to use more query string parameters in Drupal)
Comment #19
catchThe new test and comment look good. committed/pushed to 8.x, moving back to 7.x, will need a quick re-roll.
Comment #20
xjmComment #21
webchickCommitted and pushed to 7.x. Thanks!