david-szabo97 / grav-plugin-admin-addon-revisions

An extension for Grav Admin plugin which adds revisions for pages.
MIT License
11 stars 8 forks source link

Revisions are only deleted according to `limits.older` when changes are made to the page #27

Closed SimJoSt closed 1 year ago

SimJoSt commented 2 years ago

I just realized there were still revisions in the pages, even though they have been expired according to the limits.older timeframe. Checking the CLI and docs, I didn't find any commands that I would need to trigger. Checking the code it became clear, that there is no process run on the Grav schedule, but only a check when a page is modified: https://github.com/david-szabo97/grav-plugin-admin-addon-revisions/blob/0dc9c9a6cb64a58b3a2c8aadc4af1a35dc3a8702/admin-addon-revisions.php#L228-L241

Most pages, like blog posts, are never touched again, so the check never runs again. Their revisions should still be cleaned up after the time period. Some of ours had YAML linting issues. We had to delete those via the CLI now.

It would be great, if there was an option to do this via the Grav scheduler or a separate CLI command.

david-szabo97 commented 2 years ago

Thanks, I'll look into this.

david-szabo97 commented 1 year ago

Added a scheduled job in https://github.com/david-szabo97/grav-plugin-admin-addon-revisions/commit/af2a21a0d3db813856db3d81db1e3ef6df838e00 https://github.com/david-szabo97/grav-plugin-admin-addon-revisions/commit/1eaa4699b4f40217c99aecec1938132b094598f5

Released in v2.0.0