Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
forum.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
7 Mar 2008 at 19:13 UTC
Updated:
6 Jul 2016 at 22:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedIf I don't put image in a gallery, the error doesn't occur.
Comment #2
liam mcdermott commentedThis is a duplicate of #231337: conflict with Forum module?
Comment #3
andypostForum tries to replace all taxonomy links with own path at forum_link_alter
But image gallery already replaced own links with image_gallery_term_path
So we need different way to replace links or just to check term for existence!
Comment #4
yngens commentedsubscribing. where this fix should go? is it possible to post a patch file?
Comment #5
yngens commentedi would not dare to change the status of this issue, but considering that two major and very popular modules like forum and image modules are in conflict, may i set to critical. change back if i am wrong.
Comment #6
andypostPatch applied - need testing!
Comment #7
Anonymous (not verified) commentedThis patch makes no sense. Why does adding a check for $term fix anything?
The original code:
if ($term->vid == $vid) {
The modified code:
if ($term && $term->vid == $vid) {
if($term->vid == $vid) does the exact same check (and more) than if($term). The only case it makes a difference, is where both $term->vid and $vid are NULL. And this SHOULDN'T be happening. Image needs to take this into account, not the other way around.
Additionally, why are we patching core for a contributed ALPHA release module? The Image module needs to be fixed, plain and simple.
Comment #8
Anonymous (not verified) commentedDuplicate of http://drupal.org/node/231338.
Comment #9
andypostboydjd, take a closer look to the problem! Patch is fixing a notice caused by error in code
Remember, if you trying to check a property of object you SHOULD first to check the OBJECT.
So read [#3] this notice is caused by hook_term_path - forum SHOULD BE fixed not all other modules that use this hook!
Comment #10
gábor hojtsyCome on, this is a PHP notice, not a critical error. Should use !empty() instead of plainly checking against the variable.
Comment #11
gábor hojtsyAlso retitling.
Comment #12
salvisI didn't find this issue (sorry...), so I posted a new one a while back: #335111: Forum causes notices with image_gallery
It has some more detailed analysis as well as a different patch — I don't think we should call taxonomy_get_term($tid) if $tid (the result of trying to remove 'taxonomy/term/' from the path) is not numeric, because if it isn't, we're outside of what we expect.
Comment #13
andypostSuppose patch from #13 still actual so let's check this
result of taxonomy_get_term possible only Object or False so why not to check 'is there result?' before check it's properties
Comment #14
salvisYes, the assumption is that
$tid = str_replace('taxonomy/term/', '', $link['href']);operates on something like taxonomy/term/NNN where NNN is a number (the $tid).
In the case of image_gallery.module, str_replace() operates on 'image/tid/NNN', returning the unchanged 'image/tid/NNN'. What's the point of calling taxonomy_get_term('image/tid/NNN')?
Comment #15
salvisMade obsolete by #197864-13: forum module uses hook_link_alter instead of taxonomy_term_path hook.