From 3276cd5ecc52d76cb5c81bff31426b0a3431ffed Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 19 Sep 2019 08:59:29 +0100 Subject: [PATCH] Bugfix: Revision counters for new pages didn't tick upwards --- module_index.json | 24 ++++++++++++------------ modules/feature-history.php | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/module_index.json b/module_index.json index 2586ca9..39039e1 100755 --- a/module_index.json +++ b/module_index.json @@ -55,7 +55,7 @@ "version": "0.3.1", "author": "Starbeamrainbowlabs", "description": "Adds a sidebar to the left hand side of every page. Add '$settings->sidebar_show = true;' to your configuration, or append '&sidebar=yes' to the url to enable. Adding to the url sets a cookie to remember your setting.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -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": 1568295635, + "lastupdate": 1568802471, "optional": false, "extra_data": [] }, @@ -85,7 +85,7 @@ "version": "0.1.4", "author": "Starbeamrainbowlabs", "description": "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "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": 1568295635, + "lastupdate": 1568879874, "optional": false, "extra_data": [] }, @@ -135,7 +135,7 @@ "version": "0.7.1", "author": "Starbeamrainbowlabs", "description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -155,7 +155,7 @@ "version": "0.6", "author": "Starbeamrainbowlabs", "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -195,7 +195,7 @@ "version": "0.1.1", "author": "Starbeamrainbowlabs", "description": "Adds a debug action for administrator use only that collects a load of useful information to make reporting bugs easier.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -205,7 +205,7 @@ "version": "0.10.1", "author": "Starbeamrainbowlabs", "description": "Adds an action to allow administrators to delete pages.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -215,7 +215,7 @@ "version": "0.17.4", "author": "Starbeamrainbowlabs", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": { "diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js" @@ -237,7 +237,7 @@ "version": "0.9.3", "author": "Starbeamrainbowlabs", "description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -247,7 +247,7 @@ "version": "0.11.1", "author": "Starbeamrainbowlabs", "description": "Adds a page that lists all the pages in the index along with their metadata.", - "lastupdate": 1568295635, + "lastupdate": 1568296731, "optional": false, "extra_data": [] }, @@ -334,4 +334,4 @@ "ParsedownExtra.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown-extra\/f21b40a1973b6674903a6da9857ee215e8839f96\/ParsedownExtra.php" } } -] \ No newline at end of file +] diff --git a/modules/feature-history.php b/modules/feature-history.php index 2036ce5..ce132ab 100644 --- a/modules/feature-history.php +++ b/modules/feature-history.php @@ -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 * disparaty 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[] = [