History function

History function

by Warren Linds -
Number of replies: 9
When I click on history to compare versions, I get this text and only this text:

Differences between version 11 and 10 of Article for conference.


In other wikis I have used what also appears is a side by side comparision (with changes in red or some other colour) of the two versions.

Am I doing something wrong? Is there something I need to change so I can see the comparison? It seems to me if the text above is all I will get then the "history" tab is useless!

Average of ratings: -
In reply to Warren Linds

Re: History function -- correction--Diff function

by Warren Linds -
To clarify because my tech support assumed I wasn't going to "Diff" to do the compare. I was going to History, then to Diff, and all I got was the above line.
A colleague reports this is a common bug; is that true? Any work around? (If you can provide me with one, I will pass it onto tech support here.

PS: (Why isn't anyone responding to this thread?)
In reply to Warren Linds

Re: History function -- correction--Diff function

by David Korfhage -
I had a similar problem.  I eventually found that in my case anything surrounded by <p> </p> tages was "invisible" in the diff function.  I simply removed/replaced all <p> codes with <br>, and that seemed to work.  I may only be a temporary fix.  I think that if my students import text from another application (e.g. paste it in), the problem will return.  I'll see.
In reply to David Korfhage

Re: History function -- correction--Diff function --Bug fix available?

by Warren Linds -
Thanks David. My tech support people say, after doing several tests, that the problem is created when an original or subsequent document is imported from word via copy and paste. If it is imported from a text file, it is OK.

I don't know if this also happens from wordperfect, but might test it sometime.

The tech people said the problem is the HTML tags in Word which renders "difference" useless. That stupid program has so many extraneous codes in every document, I tear my hair out anytime someone sends me a Word document.

Since I am going to ask students to work in wiki in some group work, and I know they will forget what I tell them about important documents from Word, I am wondering if anyone out there is working on fixing this "bug" in moodle's wiki.

I say it is a "bug" in moodle because I have used wiki's on other servers haven't had this problem in the past.

If anyone is working on this 'bug" please speak up. It would be enormously helpful.

I am also wondering why the documents on moodle (in some handbook someone sent me..I believe it was Chapter 11) never mentions this problem of text coming from a Word program.

Thanks.
In reply to Warren Linds

Re: History function

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I filed a bug for this: MDL-7541
Please comment with additional information if possible
In reply to koen roggemans

Re: History function

by Eric Merrill -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

This appears to effect all versions, at least 1.5.3+ to 1.8

I believe I've found the fix for the problem.

In the file:
moodle/mod/wiki/ewiki/plugins/moodle/diff.php

Line 17 and 18 (just below this label): /// Replace <p>&nbsp;</p>

The regexes are:
(<p.>(&nbsp;|\s+)</p>|<p.></p>)i

That is bad, they should be:
(<p.>(&nbsp;|\s+)</p>|<p.^>></p>)i

Basically the part:
<p.*></p> will also match <p><b>test</b></p> because the "><b>test</b" counts as *, so you have <p"><b>test</b"></p> which it thinks is an empty <p> block.

The ^> says that there cant be any >'s in the *, which eliminates the problem

In reply to Eric Merrill

Re: History function

by Michael Spall -
Picture of Core developers Picture of Testers
Actually I think the fix should read like this.

/// Replace <p>&nbsp;</p>
$content0 = preg_replace('#(<p.*>(&nbsp;|\s+)</p>|<p[^>]*></p>)#i', "\n", $content0);
$content = preg_replace('#(<p.*>(&nbsp;|\s+)</p>|<p[^>]*></p>)#i', "\n", $content);

You want 0+ non-'>' characters between the 'p' and the '>'. The above solution allows just one character of any kind and then a non-'>' between the 'p' and the '>'. It will "work" because very few things will match it, but it isn't the correct solution.

In reply to Michael Spall

Re: History function

by Jason Hollowell -

I have this same problem and haven't had a chance to try the fix yet but am a little disappointed to see that this is not a new problem.  I don't have student pasting from Word but do have them pasting from within Moodle (they submitted a text assignment and then copied and pasted that text to a Wiki)  and I get nothing when I click on diff.  so the Wiki is useless for what I wanted to use it for..... sad

I'll try the fix and hope that it works but shouldn't this be added to upgrades????  1.8+ would have been a nice place for it.

Jason