https://bugzilla.wikimedia.org/show_bug.cgi?id=18856

           Summary: RevisionsBeforeDiff hook
           Product: MediaWiki
           Version: 1.15.0rc1
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: need-review, patch
          Severity: enhancement
          Priority: Normal
         Component: Page editing
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: beb...@gmail.com


Created an attachment (id=6141)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=6141)
initial patch

As far as I know there is no way to modify revision texts passed to the
difference engine. This hook, attached to the entry, provides a simple solution
to the problem. It implements RevisionsBeforeDiff hook that can be used as
follows:

...
$wgHooks['RevisionsBeforeDiff'][] = 'combineNewRevisionWithRequest';
function combineNewRevisionWithRequest( &$oldRevText, &$newRevText ) {
        if( pageIsEditable() ) {
                global $wgTitle;
                $editPage = getEditPage($wgTitle);
                $newRevText = renderProperties($editPage) . $newRevText;

                removeCommentLines($oldRevText);
                removeCommentLines($newRevText);
        }

        return true;
}
...

Even though the code is out of context I hope it manages to convey the idea and
the need for this particular feature.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to