SilverStripe Garbage Collection Module

Overview

SilverStripe Garbage Collection Module

PHPUnit codecov

Overview

SilverStripe Module for defining and processing Garbage Collection on SilverStripe Applications.

Installation

composer require brettt89/silverstripe-garbage-collector

Basic Usage

The below example shows how you can enable and configure the VersionedCollector and ChangeSetCollector for your application.

---
Name: GarbageCollectors
---
SilverStripe\GarbageCollector\Collectors\VersionedCollector:
  # Increase Versioned keep limit to 10 records
  keep_limit: 10
  # Define base classes to collect versions for
  base_classes:
    - SilverStripe\CMS\Model\SiteTree

SilverStripe\GarbageCollector\Collectors\ChangeSetCollector:
  # Reduce Changeset Lifetime to 10 days
  deletion_lifetime: 10

# Register collectors with service
SilverStripe\GarbageCollector\GarbageCollectorService:
  collectors:
    - 'SilverStripe\GarbageCollector\Collectors\VersionedCollector'
    - 'SilverStripe\GarbageCollector\Collectors\ChangeSetCollector'

Now we just need to define an execution for the GarbageCollectorService by calling GarbageCollectorService::inst()->process();. You may decide to do this in a BuildTask or Job depending on how you want to execute Garbage Collection (e.g. Crontab).

Documentation

Garbage Collection is based on the idea of removal/processing of records and items that may not have native garbage collection. This should be extendable to work with any type of data set as long as there are corresponding processors.

Components

Guides

Reporting Issues

Please create an issue for any bugs you've found, or features you're missing.

License

This module is released under the MIT License

Credits

This project is made possible by the community surrounding it and especially the wonderful people and projects listed in this document.

Contributors

Libraries

[silverstripe/framework] (https://github.com/silverstripe/silverstripe-framework)

Comments
  • Doesn't work without symbiote/silverstripe-queuedjobs installed

    Doesn't work without symbiote/silverstripe-queuedjobs installed

    Throws error without symbiote/silverstripe-queuedjobs module installed.

    Fatal error: Class 'Symbiote\QueuedJobs\Services\AbstractQueuedJob' not found

    Is this module supposed to be required?

    opened by matthewrayner 7
  • VersionedCollector only deletes rows from base class tables

    VersionedCollector only deletes rows from base class tables

    VersionedCollector->getTableNameForClass() uses DataObjectSchema->baseDataTable the base table not DataObjectSchema->tableName.

    So it ends up adding duplicate values to the class list in VersionedCollector->getTablesListForClass() when it's creating the VersionedCollector->deleteVersionsQuery() which in turn gets passed on to the SQLExpressionProcessor which causes an error.

    The best example of this is if you have a record with the class of SilverStripe\Assets\Image it will add two SilverStripe\Assets\File tables.

    bug 
    opened by matthewrayner 3
  • GarbageCollectorService tries to instantiate processors without constructor data

    GarbageCollectorService tries to instantiate processors without constructor data

    When running GarbageCollectorService::inst()->process();, it collects all collectors and processors as defined by the config.

    In https://github.com/brettt89/silverstripe-garbage-collector/blob/master/src/GarbageCollectorService.php#L92 it tries to create singletons of each processor to get their implementor class, but since they define a mandatory constructor param, this fails, e.g. SQLExpressionProcessor (https://github.com/brettt89/silverstripe-garbage-collector/blob/master/src/Processors/SQLExpressionProcessor.php#L19) requires an SQLExpression to be provided and similar for others.

    There's a couple of options how this can be handled:

    1. set the implementor class as a config variable (can't be enforced via interface)
    2. change the method to be static so that it doesn't require an object instance
    3. use reflection to create an instance without running the constructor method

    I can submit a PR if one of the options above is chosen (or a different one is suggested).

    opened by michalkleiner 3
  • Fix for MTI models

    Fix for MTI models

    As raised, the recent minor enhancement changed the way how the list of tables was collected and caused duplication of base tables instead of using the class inheritance-based approach as it was before.

    This addresses the issue and adds a test.

    Fix for #16

    opened by michalkleiner 2
  • Feature: New obsolete table collector and RawSQL processor

    Feature: New obsolete table collector and RawSQL processor

    New collector and processor for removal of _obsolete_ tables from the database.

    • Uses a new Model type RawSQL as identification does not work for non-classes objects (e.g. Arrays / Strings / etc).

    To Do:

    • [x] Write Tests.
    • [x] Documentation
    opened by brettt89 2
  • Production Ready

    Production Ready

    This issue was raised to track the Production Ready issues that may be blocking users from using this module within Production for their Applications.

    Tasks

    • [x] Remove "Warning" from README.md
    • [x] Test on actual applications thoroughly
    • [x] Determine minimum requirements and define
    • [x] Update composer.json to have version control that allows for earliest possibly dependencies
    • [x] Performance Testing
    enhancement 
    opened by brettt89 2
  • BUG: Collector job hydration fix.

    BUG: Collector job hydration fix.

    BUG: Collector job hydration fix

    The collector job needs to have a constructor which is able to run without any params. This is because once job is stored in DB as a job descriptor it will be picked up by the queue runner which will create a new instance of the job by calling the constructor without any params. Any job data assignments in such constructor call are irrelevant as the job data is populated right after that. The main thing is that the code needs to be executable.

    Changes

    • constructor is executable without any params
    • docblock update

    Related issues

    https://github.com/brettt89/silverstripe-garbage-collector/issues/28

    bug 
    opened by mfendeksilverstripe 1
  • Update VersionedCollector DataTime manipulation to support SS 4.2 -> 4.4

    Update VersionedCollector DataTime manipulation to support SS 4.2 -> 4.4

    Silverstripe Framework only added modify method to DateTime class in Silverstripe 4.5. These changes support earlier versions of Silverstripe 4 by using strtotime for modification and manually setting the value.

    Fixes: #21

    opened by brettt89 1
  • Incompatible with SilverStripe 4.2 - 4.4 - method 'modify' does not exist on DBDateTime

    Incompatible with SilverStripe 4.2 - 4.4 - method 'modify' does not exist on DBDateTime

    Hi

    Composer requirements are "silverstripe/framework": "^4.2" But it actually doesn't work on 4.4 do to this error:

    [Emergency] Uncaught BadMethodCallException: Object->__call(): the method 'modify' does not exist on 'SilverStripe\ORM\FieldType\DBDatetime' Trace SilverStripe\View\ViewableData->__call(modify, Array) VersionedCollector.php:166 SilverStripe\GarbageCollector\Collectors\VersionedCollector->getRecordsForDeletion(Array) VersionedCollector.php:98 SilverStripe\GarbageCollector\Collectors\VersionedCollector->getCollections() GarbageCollectorServiceTask.php:36 GarbageCollectorServiceTask->processCollector(SilverStripe\GarbageCollector\Collectors\VersionedCollector) GarbageCollectorServiceTask.php:26 GarbageCollectorServiceTask->process() GarbageCollectorServiceTask.php:15 GarbageCollectorServiceTask->run(SilverStripe\Control\HTTPRequest) TaskRunner.php:104

    Modify was added to DBDateTime in 4.5 https://github.com/silverstripe/silverstripe-framework/commit/844d2ef134a344bca0e39ecc4c5d8bdd75de4171

    Thanks

    bug good first issue 
    opened by jcop007 1
  • VersionedCollector doesn't collect records for all classes

    VersionedCollector doesn't collect records for all classes

    VersionedCollector stops collecting records when one of classes has no versions to delete causing it to not continue looping through all the classes.

    https://github.com/brettt89/silverstripe-garbage-collector/blob/d9a539e92ea8428b87b157f22b032d2e5beaf25f/src/Collectors/VersionedCollector.php#L102

    bug 
    opened by matthewrayner 1
  • Support FluentVersioned Extension for Versioned collector

    Support FluentVersioned Extension for Versioned collector

    FluentVersionedCollectorExtension added for collecting data that is localised using Fluent.

    Reference: https://github.com/tractorcow-farm/silverstripe-fluent/

    opened by brettt89 1
  • Collector job hydration error

    Collector job hydration error

    Collector job hydration error

    The collector job needs to have a constructor which is able to run without any params. This is because once job is stored in DB as a job descriptor it will be picked up by the queue runner which will create a new instance of the job by calling the constructor without any params. Any job data assignments in such constructor call are irrelevant as the job data is populated right after that. The main thing is that the core needs to be executable.

    Fixed in https://github.com/brettt89/silverstripe-garbage-collector/pull/27

    bug 
    opened by mfendeksilverstripe 0
  • BUG SQL syntax error when attempting to run GarbageCollectorService::process()

    BUG SQL syntax error when attempting to run GarbageCollectorService::process()

    After creating a task that calls GarbageCollectorService::inst()->process() in it's run() method, the following SQL error occurs both for mysqld Ver 10.5.9-MariaDB for osx10.16 on x86_64 (Homebrew) as well as on Silverstripe Cloud. I can't recall the MySQL version running on our stack but will work to track that down.

    Config

    ---
    Name: website-GarbageCollectors
    ---
    SilverStripe\GarbageCollector\Collectors\VersionedCollector:
      # Increase Versioned keep limit to 10 records
      keep_limit: 10
      # Define base classes to collect versions for
      base_classes:
        - SilverStripe\CMS\Model\SiteTree
    
    SilverStripe\GarbageCollector\Collectors\ChangeSetCollector:
      # Reduce Changeset Lifetime to 10 days
      deletion_lifetime: 10
    
    # Register collectors with service
    SilverStripe\GarbageCollector\GarbageCollectorService:
      collectors:
        - 'SilverStripe\GarbageCollector\Collectors\VersionedCollector'
        - 'SilverStripe\GarbageCollector\Collectors\ChangeSetCollector'
    

    Task

    class GarbageCollectionTask extends BuildTask
    {
        /**
         * @var string
         */
        private static $segment = 'GarbageCollectionTask';
    
        /**
         * {@inheritDoc}
         * @return string
         */
        public function getDescription()
        {
            return _t(
                __CLASS__ . '.Description',
                'A task used to trim Change Sets, Versions, and any other configured objects'
            );
        }
    
        /**
         * @param HTTPRequest $request
         * @throws \Exception
         */
        public function run($request)
        {
            GarbageCollectorService::inst()->process();
        }
    }
    

    MariaDB

    2021-10-05 09:53:37][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) 42000-1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID"...' at line 2" [] []
    [2021-10-05 09:53:37][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) 42000-1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID"...' at line 2" [] []
    [2021-10-05 09:53:37][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) 42000-1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID"...' at line 2" [] []
    [2021-10-05 09:53:37][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) 42000-1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID"...' at line 2" [] []
    [2021-10-05 09:53:37][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) 42000-1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID"...' at line 2" [] []
    

    MySQL

    [2021-10-05 09:57:46][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LE' at line 1" [] []
    [2021-10-05 09:57:46][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LE' at line 1" [] []
    [2021-10-05 09:57:46][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LE' at line 1" [] []
    [2021-10-05 09:57:46][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LE' at line 1" [] []
    [2021-10-05 09:57:46][ERROR] Unable to process records: "Couldn't run query: DELETE FROM "ChangeSet" LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LEFT JOIN "ChangeSetItem_ReferencedBy" ON "ChangeSetItem"."ID" = "ChangeSetItem_ReferencedBy"."ChangeSetItemID" WHERE ("ChangeSet"."ID" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN "ChangeSetItem" ON "ChangeSet"."ID" = "ChangeSetItem"."ChangeSetID" LE' at line 1" [] []
    
    opened by muskie9 2
  • VersionedCollector doesn't delete versions that were published in the past

    VersionedCollector doesn't delete versions that were published in the past

    What is the reasoning behind this? I see that you mentioned isPublishedInLocale() as a reason but I don't see why.

    I have SiteTree objects that have hundreds of different versions but as some of the versions were published they haven't been deleted even if they are hundreds of versions behind.

    This is the line of code with the comment I mentioned above.

    https://github.com/brettt89/silverstripe-garbage-collector/blob/d9a539e92ea8428b87b157f22b032d2e5beaf25f/src/Collectors/VersionedCollector.php#L282-L284

    enhancement good first issue 
    opened by matthewrayner 4
  • Support versions retention per base class in VersionedCollector

    Support versions retention per base class in VersionedCollector

    As per the title, currently, the configuration is global for all base classes defined for VersionedCollector.

    An enhancement to that can be one where base_classes config would also accept nested array indexed by the class with config overrides for that class.

    enhancement 
    opened by michalkleiner 0
Releases(1.2.0)
Owner
Brett Tasker
Brett Tasker
Silverstripe-debugbar/ - SilverStripe DebugBar module

SilverStripe DebugBar module Requirements SilverStripe ^4.0 maximebf/php-debugbar jdorn/sql-formatter Installation You can install the debug bar with

Thomas Portelange 52 Dec 21, 2022
A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in SilverStripe

A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in Silver

null 4 Apr 20, 2022
Silverstripe-fulltextsearch - Adds external full text search engine support to SilverStripe

FullTextSearch module Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS. Compatible with PHP 7.2 Important notes when

Silverstripe CMS 42 Dec 30, 2022
Silverstripe-searchable - Adds to the default Silverstripe search by adding a custom results controller and allowing properly adding custom data objects and custom fields for searching

SilverStripe Searchable Module UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.* Adds more c

ilateral 13 Apr 14, 2022
This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every translatable field.

Autotranslate This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every

null 4 Jan 3, 2022
Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance

Silverstripe Sendy Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance. Introduction

Syntro Opensource 4 Apr 20, 2022
A collection of command line scripts for Magento 2 code generation, and a PHP module system for organizing command line scripts.

What is Pestle? Pestle is A PHP Framework for creating and organizing command line programs An experiment in implementing python style module imports

Alan Storm 526 Dec 5, 2022
Silverstripe-sspy - Python based SSPAK export with higher reliability and cross-platform compatibility

SSPY - Python Stand-alone SSPAK solution © Simon Firesphere Erkelens; Moss Mossman Cantwell Usage: sspy [create|load|extract] (db|assets) --file=my.

Simon Erkelens 1 Jun 29, 2021
Sspak - Tool for managing bundles of db/assets from SilverStripe environments

SSPak SSPak is a SilverStripe tool for managing database and assets content, for back-up, restoration, or transfer between environments. The file form

Silverstripe CMS 45 Dec 14, 2022
Markdownfield - Markdown field for SilverStripe

MarkdownField This module introduces a new DB field type Markdown & Markdown Editor. It uses github style Markdown style. And uses the simple markdown

SilverStripers 10 Jul 10, 2022
Automatically delete old SiteTree page versions from Silverstripe

Version truncator for Silverstripe An extension for Silverstripe to automatically delete old versioned DataObject records from your database when a re

Ralph Slooten 35 Dec 7, 2022
Silverstripe-populate - Populate your database through YAML files

Populate Module This module provides a way to populate a database from YAML fixtures and custom classes. For instance, when a building a web applicati

Silverstripe CMS 22 Oct 3, 2022
Silverstripe-ideannotator - Generate docblocks for DataObjects, Page, PageControllers and (Data)Extensions

silverstripe-ideannotator This module generates @property, @method and @mixin tags for DataObjects, PageControllers and (Data)Extensions, so ide's lik

SilverLeague 44 Dec 21, 2022
Alerts users in the SilverStripe CMS when multiple people are editing the same page.

Multi-User Editing Alert Alerts users in the SilverStripe CMS when multiple people are editing the same page. Maintainer Contact Julian Seidenberg <ju

Silverstripe CMS 15 Dec 17, 2021
Silverstripe-tinytidy - Control which styles are available in TinyMCE's style dropdown menu and what elements they can be applied to

TinyTidy for SilverStripe This module mainly serves as an example of how to customise the 'styles' dropdown menu in the TinyMCE editor to control whic

Jono Menz 30 Jul 30, 2020
Helper plugin to install SilverStripe recipes

SilverStripe recipe-plugin Introduction This plugin enhances composer and allows for the installation of "silverstripe-recipe" packages. These recipes

Silverstripe CMS 10 Oct 4, 2022
SilverStripe Model Annotations Task

A SilverStripe Task to generate data object model annotations for defined db fields. Also for configs from data extensions.

CSoellinger 2 Apr 21, 2022
Adds a "spam protection" field to SilverStripe userforms using Cloudflare's Turnstile service.

Turnstile for Silverstripe Adds a "spam protection" field to SilverStripe userforms using Cloudflare's Turnstile service. Maintainer Contact Ed Chipma

Webbuilders Group 3 Dec 15, 2022
Demo Silverstripe and JavaScript sources for Lightning Talk "FormField Mini Apps" at StripeCon EU 2022

Watch the Lightning Talk on Youtube ?? Demo repository for Lightning Talk "FormField Mini Apps with the JavaScript framework/lib/style of your choice"

Julian Scheuchenzuber 2 Sep 20, 2022