Include path problem (patch)

Anselm Heaton - October 21, 2008 - 15:17
Project:Diff
Version:6.x-2.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Hello,

When running on my server, diff.module generates errors because it cannot find various include files. This is because it does things like

  include_once('DiffEngine.php');

directly. However "." is not in my include path ; this is not an uncommon setup, and not a requirement for Drupal to work. I have looked at other modules (such as for instance the Views module) and the way they include files is :

  include_once('./' . drupal_get_path('module', 'diff') . '/DiffEngine.php');

Bases on this, I have patched diff.module so that it works on my server - and will continue to work on other servers.

Thanks you for this useful module :) The patch is attached !

AttachmentSize
diff.module.patch928 bytes

#1

frjo - December 10, 2008 - 11:29
Status:needs review» reviewed & tested by the community

I have the same error and have made a almost identical patch for it before I found this old issue. This is the way core and modules like cck and views does it so I'm confident it's the right way.

My servers is stock Debian etch 4 with Apache 2, PHP5 and open_basedir.

I have submitted similar patches to other modules and most of them has been committed. It is good not to have maintain your own patched versions of modules so I would really appreciate if this gets committed.

#2

suit4 - April 9, 2009 - 12:46

same issue for node.inc!

#3

yhahn - April 15, 2009 - 15:22
Status:reviewed & tested by the community» fixed

Committed here http://drupal.org/cvs?commit=197118.

I've used module_load_include() instead (http://api.drupal.org/api/function/module_load_include/6). You will see that it should be functionally equivalent to the patch above. Let me know if it causes any problems.

#4

System Message - April 29, 2009 - 15:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.