Recent Changes is incompatible with Diff Module 2.x

smokris - September 24, 2008 - 12:46
Project:Recent Changes
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

If I use recent_changes.module 5.x-1.2 and diff.module 5.x-2.1, I get a blank page when viewing the RSS feed, and the following in the Apache error logs:

PHP Fatal error:  Call to undefined function _diff_table_body() in .../sites/all/modules/recent_changes/recent_changes.module on line 596

_diff_table_body() was refactored in diff.module 5.x-2.x.

Here's a patch that solves the problem for me:

<?php
Index
: recent_changes.module
===================================================================
---
recent_changes.module    (revision 4397)
+++
recent_changes.module    (working copy)
@@ -
591,10 +591,17 @@
* Interface
with the diff module. Returns a table with the differences between $node and $prev_revision
*/
function
_recent_changes_get_diff($node, $prev_revision) {
$item_text  = '<table style="width:100%">';
$item_text .= '<thead><tr><th></th><th>Revision of '. format_date($prev_revision->revision_timestamp) .'</th><th></th><th>Revision of '. format_date($node->revision_timestamp) .'</th></tr></thead>';
$item_text .= _diff_table_body($prev_revision, $node);
$item_text .= '</table>';
$header = array(
+    array(
+     
'data' => 'Revision as of '. format_date($prev_revision->revision_timestamp),
+     
'colspan' => 2
+    ),
+    array(
+     
'data' => 'Revision as of '. format_date($node->revision_timestamp),
+     
'colspan' => 2
+    )
+  );
$item_text .= theme('diff_table',$header,_diff_body_rows($prev_revision, $node));

  
// Replace css classes from diff with actual style elements since we cannot reference a css file from the rss feed.
  
$patterns = array(
?>

#1

dwarner - April 21, 2009 - 17:34

Just adding a 'me too'.

#2

dwarner - May 4, 2009 - 18:20

Also noting that the above patch fixed things for me.

 
 

Drupal is a registered trademark of Dries Buytaert.