Problem/Motivation
When attempting to preview a new node, a series of errors are produced by the module which result in the standard Drupal 'unexpected error' page being displayed.
Steps to reproduce
- Install the following modules: Revisioning, Diff, Diff Different;
- Follow the steps for creating a basic revisioning system;
- Create a new node as user one and click 'Preview'.
Error messages
Notice: Trying to get property of non-object in diff_different_get_student_teacher_revisions() (line 175 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Warning: Creating default object from empty value in diff_different_get_student_teacher_revisions() (line 179 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Warning: Creating default object from empty value in diff_different_get_student_teacher_revisions() (line 188 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$uid in diff_different_render_diff() (line 63 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$timestamp in diff_different_render_diff() (line 84 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$vid in diff_different_render_diff() (line 84 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$timestamp in diff_different_render_diff() (line 88 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$vid in diff_different_render_diff() (line 88 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$vid in diff_different_render_diff() (line 109 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
Notice: Undefined property: stdClass::$vid in diff_different_render_diff() (line 110 of /.../sites/all/modules/contrib/diff_different/diff_different.module).
(Errors are also generated by core modules, but I haven't included them above, as they all appear to be related to previous errors produced by the Diff Different module.)
NB: What do the references to 'student' and 'teacher' in the code mean? Should they be replaced with more generic terms?
I really like the sound of what this module should provide, so any efforts in attempting to resolve the problems above would be greatly appreciated!
Comments
Comment #1
rdeboerWhoa Matt!
I would not have thought that I delivered a module with so many errors out of the box!
While I start up my test rig in an attempt to reproduce these errors, can you please quote me the version numbers of those 3 modules: Diff, Diff Different and Revisioning.
Any your version of PHP too, please (you can find this on the Status Report page of your Drupal site).
Best,
Rik
Comment #2
Anonymous (not verified) commentedHey Rik,
Thanks for your reply! My apologies for not providing version number of relevant modules in my original post!
Diff Different - 7.x-1.1
Diff - 7.x-3.2
Revisioning - 7.x-1.9
I was using version 7.32 at the time, and the PHP version on my local server is 5.6.2.
Let me know if there's anything more I can do to help you out!
Regards,
Matt
Comment #4
rdeboerHi Matt,
I was able to reproduce your issue.
The code did not cover the case of a new node (i.e. very first revision) being Previewed prior to saving it.
If you try Diff Different 7.x-1.x-dev now, you should be alright. Let us know here if there is still a problem.
Rik
PS: the references to 'student' and 'teacher' refer to the student-teacher use-case/scenario that the module was created for.
You could call the roles 'journalist' and 'editor' or 'author' and 'reviewer'... anything that makes sense to you.
Those names in the code are not visible to the end user, so it doesn't really matter as long as it conveys meaning to the developer trying to understand the code, based on the use-case story.
Comment #5
rdeboerComment #6
Anonymous (not verified) commentedMany thanks for your efforts, Rik! I haven't had an opportunity to review your fix yet, but it sounds like you've nailed it. I'll report back after I've had a go with 7.x-1.x-dev.
Matt
Comment #7
rdeboerLook forward to your report!