1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-25 05:22:59 +00:00

Bugfix: Revision counters for new pages didn't tick upwards

This commit is contained in:
Starbeamrainbowlabs 2019-09-19 08:59:29 +01:00
parent b2f50f7af8
commit c8aa3b8692
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 5 additions and 5 deletions

View file

@ -75,7 +75,7 @@
"version": "0.1",
"author": "Starbeamrainbowlabs",
"description": "Displays a special page to aid in setting up a new wiki for the first time.",
"lastupdate": 1568296731,
"lastupdate": 1568802471,
"optional": false,
"extra_data": []
},
@ -95,7 +95,7 @@
"version": "0.4.2",
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to keep unlimited page history, limited only by your disk space. Note that this doesn't store file history (yet). Currently depends on feature-recent-changes for rendering of the history page.",
"lastupdate": 1568296731,
"lastupdate": 1568879874,
"optional": false,
"extra_data": []
},

View file

@ -209,7 +209,7 @@ register_module([
/**
* Adds a history revision against a page.
* Note: Does not updaate the current page content! This function _only_
* Note: Does not update the current page content! This function _only_
* records a new revision against a page name. Thus it is possible to have a
* disparity between the history revisions and the actual content displayed in
* the current revision if you're not careful!
@ -234,8 +234,8 @@ function history_add_revision(&$pageinfo, &$newsource, &$oldsource, $save_pagein
// this point
// TODO Store tag changes here
end($pageinfo->history); // Calculate the next revision id - we can't just count the revisions here because we might have a revision limit
$nextRid = !empty($pageindex->history) ? $pageinfo->history[key($pageinfo->history)]->rid + 1 : 0;
// Calculate the next revision id - we can't just count the revisions here because we might have a revision limit
$nextRid = !empty($pageinfo->history) ? end($pageinfo->history)->rid + 1 : 0;
$ridFilename = "$pageinfo->filename.r$nextRid";
// Insert a new entry into the history
$pageinfo->history[] = [