Closed (fixed)
Project:
Diff
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Nov 2009 at 19:42 UTC
Updated:
11 Apr 2012 at 20:25 UTC
Jump to comment: Most recent file
Comments
Comment #1
stian commentedJust writing to confirm the bug... We are two at work with the same problem, both on php 5.3.0. The others are fine.
Do you really need to pass the $node as reference in diff_diffs_overview(&$node) ?
Comment #2
Sera commentedIt's the same for 2.1-alpha3.
I tried to remove all & in
lines 92, 145, 182, 226 in diff.module
and in lines 7, 22, 116, 126, 145, 234, 319, 339 in diff.pages.inc
but beside the warning disappearing (good) the diffs were not shown still (bad). - So either I removed too much, or something else is broken also.
Comment #3
dagdag commentedYes I have updated several modules including this one to the alpha3 and it was showing me something like this when trying to compare a revision to the current revision:
I tried the last dev revisioning module and the same behavior, the I come back to alpha2 and it was gone, but when a try to compare two revisions they are not shown. I'm using php 5.3
well I don't sure if this the cause of my problems, because my drupal installation starts to give problems after installing some block related modules. Howewer the php item seems to be true.
revisioning 6.x -2.7
diff 6.x-2.1-alpha2
xampp 1.7.2
drupal 6.14
Comment #4
fractile81 commentedWorth mentioning that this is a problem in the current stable release too (6.x-2.0). Removing the & in the following function definitions appears to fix the problem:
* diff_diffs_overview();
* diff_node_revisions(); - shouldn't the & be on $form_state instead?
* diff_diffs_show();
Dropping the & in the above function definitions got things working for me. Not sure if this will work for the alpha.
Comment #5
kribby commented@ #4, That allows the revisions page to appear, but brings the following warnings:
* warning: Parameter 1 to node_diff() expected to be a reference, value given in C:\wamp\www\includes\module.inc on line 471.
* warning: Parameter 1 to taxonomy_diff() expected to be a reference, value given in C:\wamp\www\includes\module.inc on line 471.
* warning: Parameter 1 to content_diff() expected to be a reference, value given in C:\wamp\www\includes\module.inc on line 471.
* warning: date_diff() expects parameter 1 to be DateTime, object given in C:\wamp\www\includes\module.inc on line 471.
Node revision comparisons still appear to be nonfunctional, stating "No visible changes" despite changes being present.
Modified a clean 6.x-2.0 install, PHP 5.3.
Comment #6
Amoline commentedI'm experiencing the same issue - Revisions page is blank when you click on it. When you go back a page, you see:
warning: Parameter 1 to diff_diffs_overview() expected to be a reference, value given in ...\menu.inc on line 348.
This wasn't an issue when there were around 10 revisions. My site now has close to 1000 nodes and that's when this started acting up. Has anyone else seen similar effects?
Comment #7
nick.c commentedCan confirm the same issue.
Comment #8
Robbert commentedI've removed many incorrect reference symbols (&'s). My patch is attached.
Comment #9
oriol_e9gtagged
Comment #10
nileshgr commentedplease upload a proper patch.use diff -nComment #11
nileshgr commentedHere's a proper patch in RCS format.
Comment #12
berdirThis is wrong, the by reference is needed here.
It's not needed currently to be by reference, but also not necessary to remove.
Note that there are also wrong hook implementations in content.module and date.module and probably more..
Powered by Dreditor.
Comment #13
nileshgr commentedFixed. Check the new patch.
Comment #14
brianmercer commentedStill getting the following error after applying the patch at #13 to 6.x-2.1-alpha3:
Thanks.
Comment #15
berdirThat needs to be fixedi in CCK, not here.
Comment #16
brianmercer commentedThanks.
http://drupal.org/node/714762
Comment #17
ShutterFreak commentedI was happy to see this ticket. I'm just seeing the ripple effect of PHP 5.3 rollout on my Drupal site. Apparently the two major effects of PHP 5.3 are strict checking of by-value versus by-reference argument passing, and obsolescence of the ereg regular expression library.
Comment #18
Sera commented#13 works nicely for 6.x-2.1-alpha3
Nevertheless I get the following error message:
warning: date_diff() expects parameter 1 to be DateTime, object given in [myinstallation]/includes/module.inc on line 483.
Comment #19
Reg commentedAlso I noticed you are using pass by ref. to go into module_invoke_all() in the routine _diff_body_rows(). You should be aware there is an issue with module_invoke_all() and pass by ref. which has caught many people because it uses the function call_user_func_array() and people don't realize it changes the rules for passing variables, as in:
Comment #20
smartinm commentedThe date_diff warning message (expects parameter 1 to be DateTime, object given in ...) is due to a clash with PHP 5.3's date_diff() function when date.module is enabled. It is not wrong hook implementation (date.module don't implement hook_diff).
The attached patch fixes the problem avoiding use module_invoke_all(), also includes parameters by reference fixes.
Comment #21
hswong3i commentedPatch based on #20, plus:
Fully tested with Drupal 6.17 + Debian Squeeze + PHP 5.3.2-1 + diff 6.x-2.x-dev, with date.module DISABLED.
BTW, I would like to suggest not avoiding the use of module_invoke_all() but rename hook_diff() as something other. E.g. we may rename it as hook_ddiff(), which similar as devel.module dprint_r() function.
For sure that may generate more workload for patching, but this would be a long term solution since date_diff() is an official function call for PHP >= 5.3.0 which we shouldn't conflict with.
Comment #22
hswong3i commentedPatch based on #21, plus:
$node_diffs = module_invoke_all('ddiff', $old_node, $new_node);implementation.Fully tested with Drupal 6.17 + Debian Squeeze + PHP 5.3.2-1 + diff 6.x-2.x-dev, with date.module ENABLED.
BTW, if this solution is acceptable, we should also patch cck/includes/content.diff.inc as required.
Comment #23
smartinm commentedIMHO, rename hook_diff() must be discussed in a separate issue because it involves a change in the API.
Patch #20 uses
module_invoke()for each module enabled, asmodule_invoke_all(), the only difference to avoid call date_diff() if date.module is enabled.Comment #24
hswong3i commented@smartinm: agree that rename of hook_diff() should belongs to other individual discussion; #21 just target to demonstrate its possibility.
Patch revoke via #20, plus some @todo and @link comments for any other follow up issues if required. No other else changes.
If the patch looks fine, should we RTBC this issue?
Comment #25
Sera commented[edited post] The date_diff warning is gone. #24 is perfect :)
Comment #26
sterndata commentedAny chance of this getting released (as opp to a patch)?
Comment #27
gagarine commentedtracking
Comment #28
jmiccolis commentedI'm not quite sure about the patch in #24, specifically because it mixes a lot of unrelated white spaces fixes and function signature changes with what is a legitimate fix.
Let's focus on the 5.3 fix here, and move the other fixes to other issues.
Comment #29
jmiccolis commentedAfter taking a close look here I think that the patch in #20 is what we want to commit. Setting this thread to RTBC based on that patch.
Comment #30
yhahn commentedPatch in #20 committed here: http://drupal.org/cvs?commit=405564
Agreed that any hook rename conversations can be moved to another thread.
Comment #32
jrsinclair commentedI know this is closed, but does anyone know if this has been pushed through to the D7 version?
Comment #33
danepowell commentedIt looks like this made it into 7.x-2.x, but not into 7.x-1.x. Is 7.x-1.x even an active branch anymore? That's what drush dled by default...
Comment #34
danepowell commentedSorry! Didn't mean to change issue status.
Comment #35
darrell_ulm commentedHi, can anyone familiar with the issue verify if this has been ported.
Does comment http://drupal.org/node/639320#comment-4230860 verify this?
Thank you,