Skip to content

fix(Workspace): Purge and remove transport files via package workspace paths#16936

Open
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev:fix/16929-package-purge-workspace-paths
Open

fix(Workspace): Purge and remove transport files via package workspace paths#16936
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev:fix/16929-package-purge-workspace-paths

Conversation

@Ibochkarev
Copy link
Copy Markdown
Collaborator

What does it do?

Introduces TransportPackageFilesystemTrait with resolveTransportPaths() so Purge and Remove locate the .transport.zip and unpacked directory using the package’s workspace path + packages/ (and source / signature basename), matching how transport artifacts are laid out on disk—not only under core_path/packages/. Shared zip/unlink and deleteTree logic lives in the trait (same logging as before). Purge keeps batch-friendly behaviour (removePackage(true) with optional remove() fallback; skip filesystem cleanup when both artifacts exist but neither DB removal succeeds). Remove tries remove() after a failed removePackage() before failing the request. PHPUnit adds coverage for path resolution and purge/remove flows; phpunit.xml registers Tests/Processors/Workspace.

Why is it needed?

Manually uploaded packages (often with no provider) are stored under the workspace packages directory. The previous implementation always used core_path + packages/, so Purge Old Packages could report success while leaving old versions and files on disk for those uploads (issue #16929).

How to test

  • Run PHPUnit (Processors suite or filter TransportPackageFilesystemTrait|PackagesPurgeRemove).
  • Manual: upload multiple versions of a package without a provider, run Purge Old Packages, confirm older signatures disappear from the manager and that zip/unpacked folders under the workspace packages/ directory are removed as expected.

Related issue(s)/PR(s)

Resolves #16929

…paths

Resolve transport zip and unpacked directory paths from the package workspace
(aligned with modTransportPackage transport layout), with fallback to core
packages when no workspace row exists. Share filesystem cleanup via
TransportPackageFilesystemTrait; add PHPUnit coverage for path resolution
and purge/remove flows.

Resolves modxcms#16929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to bulk purge uploaded packages

1 participant