This causes PHP warning and notices:
Warning: Missing argument 1 for taxonomy_autocomplete() in taxonomy_autocomplete() (line 79 of .../modules/taxonomy/taxonomy.pages.inc).
Notice: Undefined variable: field_name in taxonomy_autocomplete() (line 80 of .../modules/taxonomy/taxonomy.pages.inc).
Notice: Undefined variable: term_matches in taxonomy_autocomplete() (line 126 of .../modules/taxonomy/taxonomy.pages.inc).
Comments
Comment #1
starsinmypockets CreditAttribution: starsinmypockets commentedsub
Comment #2
swentel CreditAttribution: swentel commentedPatch attached.
Comment #3
c960657 CreditAttribution: c960657 commentedIs this still an issue in D8 after #93854: Allow autocompletion requests to include slashes has been fixed?
Comment #4
fangel CreditAttribution: fangel commentedSwentel: The $matches array is never used, only $term_matches is - so you can simplify the code further by removing $matches..
You can see my patch in the more-or-less duplicate issue #665420: taxonomy autocomplete throws notice on non match
Comment #5
xjmThe patch here also needs to be rerolled for the
core/
change at least, and we should add a test.Tagging as novice for two tasks:
$matches
variable as suggested above. (See the patch in #665420: taxonomy autocomplete throws notice on non match.)Comment #6
nanotube CreditAttribution: nanotube commentedI will take a stab at this, give me some time to figure out how to write the test for this.
Comment #7
xjm@nanotube -- Are you still looking into this issue? If not we'll unassign it for someone else to take a crack at it. Thanks!
Comment #8
swentel CreditAttribution: swentel commentedI'll take it this weekend.
Comment #9
xjmThanks swentel. Since this is your patch to begin with that make sense. In general though, could you give the assignee maybe a day or to two reply, just in case they're about to post something? (Especially for novice-tagged issues.) Thanks!
Comment #10
swentel CreditAttribution: swentel commentedTwo patches, first one with test alone, this will fail. Second one with fix, should pass.
Comment #11
oriol_e9gWe need to document the new optional variable:
Should be:
Comment #12
swentel CreditAttribution: swentel commentedI'm not sure about that, since without a field_name this function simply does nothing. The patch simply makes sure no notices are triggered, let's get some more opinions on this.
Comment #13
oriol_e9gYes, you're right.
Comment #14
xjmHmm, good point. In that case we should document that fact in the parameter documentation, I think.
Comment #15
nanotube CreditAttribution: nanotube commentedThanks swentel! I got tied up. I thought the test result was supposed to be "[ ]", never got it to pass on my end.
Comment #16
JvE CreditAttribution: JvE commentedRe-rolled for changes to tests in D8.
And to bump the issue.
Comment #17
star-szr#16: drupal-taxonomy-autocomplete-notices-combined-1242602-16.patch queued for re-testing.
Comment #19
swentel CreditAttribution: swentel commentedThis isn't relevant anymore for D8
Comment #20
star-szrThanks @swentel! Backporting the patch from #16 for Drupal 7 would be a great novice task.
Edit: Instructions here.
Comment #21
babruix CreditAttribution: babruix commentedAttached backport patch for D7.
Comment #23
star-szr#21: drupal-taxonomy-autocomplete-notices-combined-1242602-21.patch queued for re-testing.
Comment #24
oriol_e9gGo with this! It's only a notice removal!
Comment #25
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/054c8ab
This also has the "needs backport to D6" tag, so if someone wants to reopen it for backport please feel free. (However, it's my impression that non-security-related patches have not been committed to Drupal 6 for a long time.)