Skip to content
This repository

This allows easier identifying of which version has been restored (FS#2522) #100

Merged
merged 1 commit into from almost 2 years ago

4 participants

Matthias Schulte Dominik Eckelmann Andreas Gohr Anika Henke
Matthias Schulte
lupo49 commented May 08, 2012

No description provided.

Matthias Schulte Restore page versions - add timestamp of the restored version to to t…
…he summary field.

This allows easier identifying of which version has been restored. (FS#2522)
d6b9c7b
Dominik Eckelmann
Collaborator
dom-mel commented May 08, 2012

what about a link to the version on the timestamp?

Matthias Schulte
lupo49 commented May 08, 2012

Is there any function which receives the $ID and $REV and returns the wiki link or should I use

$oldversion = '<a class="wikilink1" href="'. wl($ID).'&rev='.$REV.'">'.dformat($REV).'</a>'; 
Matthias Schulte
lupo49 commented May 08, 2012

Mh.. it seems you can not add links to the revision listing nor the recent changes? It just shows plain text instead of the link.

Andreas Gohr
Owner

wl($ID,array('rev'=>$REV)) is the function you're looking for.

Andreas Gohr
Owner

The revision summary is HTML escaped and is not passed through the wiki parser. To link it we'd need to run it through its own little parser, eg. replacing everything that looks like a timestamp.

Matthias Schulte
lupo49 commented May 08, 2012

What would you suggest? I think the plain timestamp would help a lot and the link is just a bonus.

Dominik Eckelmann
Collaborator
dom-mel commented May 09, 2012

I think its ok - but with link would be better :-)

Andreas Gohr
Owner

Hmm let's have short discussion on the why first. @lupo49 what's your usecase for that feature?

Matthias Schulte
lupo49 commented May 09, 2012
  1. User A, B, C are modifying a wiki page
  2. User D accidentally restored an older version of the page
  3. User A, B, C are know modifying the old page version -> All old stuff of 1. is lost
  4. User D noticed that the restored wasn't that good and he needs to know which version has been restored by him in 2. The version information would help to locate the page changes between 1. and 2. to manually recover them.

In general, you "always" know when an old page version has been restored but never which version it was.

Dominik Eckelmann
Collaborator
dom-mel commented May 09, 2012

talked to @splitbrain, a link isn't necessary. The old page and the restored page have exactly the same content. So i'm fine with this.

Andreas Gohr
Owner

I just talked with @dom-mel about this. A link wouldn't be that helpful anyway, because it would link to the the old revision that is exactly the same as the current one.

So I guess we can just merge this as is.

Andreas Gohr splitbrain merged commit c7217c0 into from May 09, 2012
Andreas Gohr splitbrain closed this May 09, 2012
Anika Henke
Collaborator

I noticed today that the pre-populated message reads old revision restored (%s), i.e. the "%s" is not interpreted.

Anika Henke
Collaborator

$lang['restored'] is used in three places and was only changed to use sprintf() in one place. It should either be changed in the other places, too, or this one instance should be changed to use something else for the replacement.

Matthias Schulte
lupo49 commented June 10, 2012

I opened another Pull Request to fix this. (#105) 7656ee3

(Sorry, don't know how to apply the commit to this request.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 08, 2012
Matthias Schulte Restore page versions - add timestamp of the restored version to to t…
…he summary field.

This allows easier identifying of which version has been restored. (FS#2522)
d6b9c7b
This page is out of date. Refresh to see the latest.
2  inc/actions.php
@@ -380,7 +380,7 @@ function act_revert($act){
380 380
     if($REV){
381 381
         $text = rawWiki($ID,$REV);
382 382
         if(!$text) return 'show'; //something went wrong
383  
-        $sum  = $lang['restored'];
  383
+        $sum = sprintf($lang['restored'], dformat($REV));
384 384
     }
385 385
 
386 386
     // spam check
2  inc/lang/de-informal/lang.php
@@ -191,7 +191,7 @@
191 191
 $lang['by']                    = 'von';
192 192
 $lang['deleted']               = 'gelöscht';
193 193
 $lang['created']               = 'angelegt';
194  
-$lang['restored']              = 'alte Version wiederhergestellt';
  194
+$lang['restored']              = 'alte Version wiederhergestellt (%s)';
195 195
 $lang['external_edit']         = 'Externe Bearbeitung';
196 196
 $lang['summary']               = 'Zusammenfassung';
197 197
 $lang['noflash']               = 'Das <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> wird benötigt, um diesen Inhalt anzuzeigen.';
2  inc/lang/de/lang.php
@@ -193,7 +193,7 @@
193 193
 $lang['by']                    = 'von';
194 194
 $lang['deleted']               = 'gelöscht';
195 195
 $lang['created']               = 'angelegt';
196  
-$lang['restored']              = 'alte Version wieder hergestellt';
  196
+$lang['restored']              = 'alte Version wieder hergestellt (%s)';
197 197
 $lang['external_edit']         = 'Externe Bearbeitung';
198 198
 $lang['summary']               = 'Zusammenfassung';
199 199
 $lang['noflash']               = 'Das <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> wird benötigt, um diesen Inhalt anzuzeigen.';
2  inc/lang/en/lang.php
@@ -191,7 +191,7 @@
191 191
 $lang['by']                    = 'by';
192 192
 $lang['deleted']               = 'removed';
193 193
 $lang['created']               = 'created';
194  
-$lang['restored']              = 'old revision restored';
  194
+$lang['restored']              = 'old revision restored (%s)';
195 195
 $lang['external_edit']         = 'external edit';
196 196
 $lang['summary']               = 'Edit summary';
197 197
 $lang['noflash']               = 'The <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> is needed to display this content.';
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.