Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In D7 when I enter any title for a taxonomy term and click Save, I get the following errors:
* Notice: Undefined variable: term in taxonomy_title_taxonomy_term_update() (line 42 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
* Notice: Trying to get property of non-object in taxonomy_title_taxonomy_term_update() (line 42 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
* Notice: Undefined variable: term in taxonomy_title_taxonomy_term_update() (line 43 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
* Notice: Trying to get property of non-object in taxonomy_title_taxonomy_term_update() (line 43 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
* Notice: Undefined variable: term in taxonomy_title_taxonomy_term_update() (line 43 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
* Notice: Trying to get property of non-object in taxonomy_title_taxonomy_term_update() (line 43 of /home/pamelapotter/public_html/sites/all/modules/taxonomy_title/taxonomy_title.module).
Any ideas?
Comment | File | Size | Author |
---|---|---|---|
#2 | taxonomy_title.zip | 8.67 KB | ownage |
Comments
Comment #1
mpotter CreditAttribution: mpotter commentedHere is a quick fix:
In taxonomy_title.module, both the "taxonomy_title_taxonomy_term_update" and "hook_taxonomy_term_insert" functions are simply missing the $term argument as per the API. Not sure how this every worked for anybody using the D7 version. So here is the correct code:
Simple fix.
Comment #2
ownage CreditAttribution: ownage commentedPerfect fix, mpotter!
Attached is the fixed version (full module) to save anyone time.
Great module btw; it's the only solution to getting the correct page title with taxonomy terms if your parent menu link is linked to the first child. Otherwise it would normally give the page title of the parent. Works like a charm!
Comment #3
jenlamptonI don't have any D7 sites using this in production yet (maybe it didn't every work for anyone?), so thank you for testing :) I'll get to these fixes shortly.
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedYes.Actually the $term argument is missing only from the
taxonomy_title_taxonomy_term_update()
I couldnt create a patch cause there is no 7.x version in git:)
But its an easy fix yes
Comment #5
jenlamptonGit branch created (fo realz this time) and fix committed.
Thanks,
Jen