Download the PHP package edwilde/silverstripe-legacy-versioned-repair without Composer

On this page you can find all versions of the php package edwilde/silverstripe-legacy-versioned-repair. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-legacy-versioned-repair

Legacy Versioned Repair

Repairs SilverStripe 3/4-era folders that SilverStripe CMS 6 misclassifies as "archived", which blocks creating files and sub-folders inside them for every user, including administrators. In practice this means users cannot upload new files or create sub-folders inside an affected folder, even as an administrator: the "Create folder" button briefly shows a spinner and then reverts with no error message, and new uploads never complete. Replacing an existing file still works, which is often the tell that a site is hitting this.

Related upstream issue: silverstripe/silverstripe-asset-admin#1689.

The problem

Folders migrated from SilverStripe 3 or 4 can have File.Version = 0 and no File_Live row. CMS 5 never consulted versioning state when creating files, but CMS 6 does: Hierarchy::canCreate() calls $parent->canAddChildren(), which calls Versioned::isArchived(). isArchived() reads isOnDraft(), and isOnDraft() treats the stage row's Version number as a boolean. A row with Version = 0 therefore reads as "not on draft", and with no live row the folder is deemed archived, so adding children is refused.

The folder looks normal but cannot have files or sub-folders created inside it. Because the check runs before the usual admin permission bypass, even administrators are blocked.

Requirements

Installation

Usage

The task is a dry run by default and only reports how many folders are affected.

Dry run:

Alternatively, open the task URL while signed in as an administrator:

To queue the repair, pass --confirm (CLI) or ?confirm=1 (HTTP):

This queues a single RepairLegacyFolderVersionsJob on the normal queue, which every install processes. The job repairs a small chunk of folders on each process() call and resumes itself until none remain, so it is safe for large sites: it parks as Waiting between chunks rather than exhausting worker memory. Watch progress in the Jobs admin at /admin/queuedjobs. Re-running the dry run afterwards should report zero.

The task is idempotent and safe to run more than once. Clicking confirm again while a job is queued or running does not create a duplicate.

How the repair works

Each affected folder is force-written with no field changes. The write is performed on the live stage: Versioned::augmentWrite() writes both the draft and live rows, bumping the version off zero and creating the live row, which un-archives the folder. Folder::updateChildFilesystem() early-returns on the live stage, so the recursive child-write cascade never fires. A draft write would recurse into every descendant file and folder, which on a near-root folder can exhaust worker memory and needlessly republish child files.

Only folders are repaired. Plain files inherit their permission and versioning behaviour differently and are not affected by this issue.

Configuration

The job runs on the normal queue by default. On a large site that runs a dedicated large-queue processor, move it to that queue so the long repair does not tie up the normal-queue worker:

This is one-shot tooling. Once the repair has run you can disable both the task and the job, which removes the task from /dev/tasks and makes any queued job a no-op:

Licence

BSD-3-Clause. See LICENSE.


All versions of silverstripe-legacy-versioned-repair with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
silverstripe/framework Version ^6.1
silverstripe/assets Version ^3.1
silverstripe/versioned Version ^3.1
symbiote/silverstripe-queuedjobs Version ^6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package edwilde/silverstripe-legacy-versioned-repair contains the following files

Loading the files please wait ...