gkrid / dokuwiki-plugin-approve

GNU General Public License v2.0
4 stars 17 forks source link

Initial approval #46

Open macin opened 7 months ago

macin commented 7 months ago

Hi, I have enabled the plugin while I've already had number of pages in my dokuwiki. It seems now every page requires approval, however I am not able to approve every sigle page because of the message "no way to compare when less than two revisions". The reason might be our workflow- we snapshot part of dokuwiki to archive some pages quite regularly, and all those archive pages require approval. Is there a way to bulk mark them as approved? What would be recomended approach working with copying of the pages process seen by dokuwiki as external edit?

ardy513 commented 6 months ago

I have a very similar question.

brozkeff commented 5 months ago

Basically the metadata for approve plugin are stored in sqlite database "approve" and in two tables. You could generate list of pages you need to mass approve and their entire name including the namespace and construct a sql command and push all these records to the sqlite database manually once.

Structure of the relevant tables is:

CREATE TABLE "page" (
    page TEXT PRIMARY KEY,
    approver TEXT NULL,
    hidden BOOLEAN NOT NULL DEFAULT 0
);
CREATE TABLE revision (
    page TEXT NOT NULL,
    rev INTEGER NOT NULL,
    ready_for_approval TEXT NULL,
    ready_for_approval_by TEXT NULL,
    approved TEXT NULL,
    approved_by TEXT NULL,
    version INTEGER NULL,
    current BOOLEAN NOT NULL DEFAULT 0,
    PRIMARY KEY (page, rev)
)

Using sqlite plugin you can as an admin download the .sqlite3 files of existing data in your wiki, using e.g. https://sqlitebrowser.org/ or DBeaver open such sqlite database and perform the necessary operations there and then upload new sqlite files to the dokuwiki installation via ssh or ftp, considering no changes were performed in the wiki in the meantime. Ideally perform everything on a test clone of entire wiki and once the procedure is working make the wiki offline for a moment, perform the db update and reupload to the production environment and turn the wiki on again. This manual method is not suitable for repeated and easy use but can be good enough when needed to perform this just once.