conflict with image module?

daouverson2 - March 7, 2008 - 19:13
Project:Drupal
Version:6.x-dev
Component:forum.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:patch (code needs review)
Description

error:

notice: Trying to get property of non-object in /var/www/vhosts/drupal6/modules/forum/forum.module on line 473.

screenshot or error:

http://www.screencast.com/users/daouverson2/folders/Jing/media/f6437e48-...

#1

daouverson2 - March 7, 2008 - 19:15

If I don't put image in a gallery, the error doesn't occur.

#2

Liam McDermott - March 11, 2008 - 16:40
Status:active» duplicate

This is a duplicate of #231337: conflict with Forum module?

#3

andypost - March 28, 2008 - 09:14

Forum 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!

      $tid = str_replace('taxonomy/term/', '', $link['href']);
      $vid = variable_get('forum_nav_vocabulary', '');
      $term = taxonomy_get_term($tid);
//      if ($term->vid == $vid) {
      if ($term && $term->vid == $vid) {

#4

yngens - April 2, 2008 - 09:34

subscribing. where this fix should go? is it possible to post a patch file?

#5

yngens - April 2, 2008 - 09:36
Priority:normal» critical

i 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.

#6

andypost - April 13, 2008 - 13:12
Status:duplicate» patch (code needs review)

Patch applied - need testing!

AttachmentSize
forum-vid.txt726 bytes

#7

boydjd - April 16, 2008 - 07:52
Project:Drupal» Image
Version:6.x-dev» 6.x-1.x-dev
Component:forum.module» image_gallery
Priority:critical» normal

This 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.

#8

boydjd - April 16, 2008 - 07:53
Status:patch (code needs review)» duplicate

Duplicate of http://drupal.org/node/231338.

#9

andypost - April 16, 2008 - 09:05
Project:Image» Drupal
Version:6.x-1.x-dev» 6.x-dev
Component:image_gallery» forum.module
Priority:normal» critical
Status:duplicate» patch (code needs review)

boydjd, 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!

 
 

Drupal is a registered trademark of Dries Buytaert.