Closed (fixed)
Project:
Diff
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2007 at 15:39 UTC
Updated:
14 Feb 2007 at 18:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
rötzi commentedHere's an updated version. The changes are:
1. No 'diff' tab anymore, but the 'revisions' tab is overwritten since the whole functionality is reproduced anyway.
2. Fields that did't change are not shown anymore (so no 'no changes in title' anymore if the title didn't change)
3. The diff output is now run through Drupal's check_plain function. It's basically the same as before, but if Drupal should change this function in the future, the diff engine is alredy up-to-date.
Comment #2
rötzi commentedAnd again some adjustments:
1. The diff module can adjust its weight automatically to be loaded after the node module. (http://drupal.org/node/112773)
2. Fixed a bug in the upload_diff hook.
3. Extracted the different hook implementation into own files.
Since I can't attach a tar.gz anymore (it's not on the list with allowed extensions) I have uploaded it here:
http://tschannen.net/diff-070125.tar.gz
Comment #3
dwwthis *TOTALLY* kicks ass. ;) this is such a VASTLY superior UI, i don't even know where to start in praising it's mightiness.
i also confirmed that even though you're diff'ing against the user's input, not the output (which is a feature), that the resulting diff output isn't a security hole. so that's good. ;)
however, a few nits:
›for the prev/next diff links, instead of>>, etc.theme('table', ...)does way too much junk you don't want, so i certainly don't fault you for this. just wanted to point it out in case anyone had any better ideas.after playing with it pretty heavily, and a quick look at the code, that's all i came up with. there's probably more that would be found by someone who wasn't looking at 5am without sleep. ;) someone should therefore do a more careful line by line review (preferably after you'd already fixed all of these issues) before we actually commit this, but i'm *VERY* impressed, and very much in favor of moving to this version ASAP. i haven't looked at cck.inc or taxonomy.inc, but upload.inc and node.inc work great.
once this gets committed and people start to see this, i predict diff.module will become one of the most popular downloads on drupal.org. ;)
thanks so much!
-derek
Comment #4
dwwwhoops, here's that patch i promised.
Comment #5
dwwand here's a screenshot of the resulting revisions tab.
Comment #6
dwwfor comparison, a screenshot of the original UI from the tar.gz in comment #2 above.
Comment #7
dwwoh right, Heine reminded me why drupal_goto() is evil in a submit handler (point #8 in my list above): if you do that, none of the other submit handlers that might be added to this form via hook_form_alter() will get called. ;) i knew there must have been a reason...
Comment #8
dwwjust since rDouglass is too lazy to install this for himself ;) i'm posting a screen shot of the diff view which spans a few revisions, and shows off some of the coolness of node.inc and upload.inc...
Comment #9
robertdouglass commentedWell, I installed it, and it rocks, I agree. My revisions links are now broken, however: q=node/28/revisions/38/view
Could this be a byproduct of the module hijacking the Revisions tab?
Comment #10
rötzi commentedThanks for the feedback. To your points:
1. In my current version the weight gets adjusted automatically and it worked. I will test that again. I'm doing it at the moment in the hook_requirements check so that if the weights should ever get changed after installation, the check is made again and the weight adjusted accordingly.
however, a few nits:
3. I like the button in the header.
4/5. I will adjust it to the drupal standard.
6. The diff-engine returns whole tablerows (<tr>...</tr>). So to use the theme('table') stuff I would have to split this up into an array again. I don't think this is worth the trouble.
8. Thanks for the tip. Didn't knew that.
9. Yes.
10. Taxonomy ignores revisioning (a bug or a feature?) so there is no need to include that at the moment. The code in the taxonomy.inc is commented anyway because of this.
To the broken revision links. You are right. I never clicked one of those links anymore after I installed the diff. It just looks to nice to have the diff when looking at a revision ;)
I will fix the issues brought up here and will upload a new version.
Comment #11
moshe weitzman commentedonce we address these issues, i will overwrite current diff with this one (HEAD and D5).
FYI, I think a separate patch which brought taxonomy into the revisions system would be welcome. The current system is a known limitation, not a deliberate and permanent choice.
Comment #12
moshe weitzman commentedComment #13
rötzi commentedNext version:
1. incorporates patch by dww
2. adhere to style guidelines (for the 'else' and 'switch' statements at least)
3. conditionally include inc files
4. view of a single revision works
5. the weight adjustment through hook_requirements works for me (no need to click a link anymore, the weight is changed automatically)
Get it from here:
http://tschannen.net/diff-070130.tar.gz
Comment #14
rötzi commentedold title was still in my submit form...
Comment #15
m3avrck commentedFound a bug, see screenshot.
In this screenshot, I only have 2 revisions. That screenshot produces a URL in the form: node/9/revisions/view/9/10
If I swap the radios to do an inverse diff, the URL is *still* : node/9/revisions/view/9/10
However, if you swap it manually in the URL, it works as specified.
The culprit is:
It always puts the old first, then new. This is wrong, it should be smart enough to know which one is selected first. Might be tricky though, not sure of a good idea for a patch atm.
Comment #16
rötzi commentedActually it is by intention that the old version is always on the left. This is just the natural flow of reading. It would be nice if it was not possible to select the other way around at all. See the way wikipedia handles this here: http://en.wikipedia.org/w/index.php?title=Drupal&action=history
Comment #17
m3avrck commentedSounds like jQuery to the rescue!
Good point, makes sense to follow the biggest diff-er out there ;-)
Comment #18
dwwi just finished a major cleaning of the code. mostly code style, but also a little bit of logic cleanups, t() fixes, minor code-reorg, and a few UI changes (hopefully for the better).
http://drupal.org/files/issues/diff-070130-dww.tar.gz
(ahh, the joys of shell access to d.o) ;)
Comment #19
dwwnow committed to HEAD and DRUPAL-5. DRUPAL-5 version installed on scratch.drupal.org for testing.
hopefully we can get some quick feedback to ensure it's working for everyone, then i'll make a 5.x-1.1 official release for this.
Comment #20
(not verified) commented