Skip to content

Conversation

@AndyButland
Copy link
Contributor

@AndyButland AndyButland commented Oct 22, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Addresses: #20602 and umbraco/Umbraco.Forms.Issues#1472

Description

This PR corrects and cleans up the constructor hierarchy for file system based tree controllers and fixes the backward compatibility regression discussed in the linked issues.

Testing

Firstly verify that the scripts, partial views and stylesheets trees work as before.

Then to check backward compatibility, modify some controllers - e.g. RootScriptTreeController and ChildrenScriptTreeController to keep only the constructor with this signatures: FileSystems fileSystems. Verify that the scripts tree works as before.

@mattbrailsford / @rickbutterfield - ideally if you could take the build from this PR and verify that it resolves the issue for Forms please, that would be a good check too.

Copilot AI review requested due to automatic review settings October 22, 2025 11:20
@AndyButland AndyButland changed the title Trees: Restore backward compatibility for file system based tree controllers. Trees: Restore backward compatibility for file system based tree controllers (closes #20602) Oct 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restores backward compatibility for file system based tree controllers by fixing constructor hierarchies and removing dependencies on the now-obsolete StaticServiceProvider. The changes ensure that controllers extending from the base classes can continue using legacy constructors (e.g., accepting only FileSystems) until they can be updated to use the newer service-based approach.

Key changes:

  • Introduced a _useFileSystemTreeService flag in FileSystemTreeControllerBase to support both legacy and service-based implementations
  • Removed StaticServiceProvider dependencies across all tree controller classes
  • Standardized obsolescence messages and updated removal timeline to Umbraco 18/19

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FileSystemTreeControllerBase.cs Added flag-based routing to support both legacy FileSystem-based and new service-based implementations
StylesheetTreeControllerBase.cs Removed StaticServiceProvider, updated constructor chain and obsolescence messages
ScriptTreeControllerBase.cs Removed StaticServiceProvider, updated constructor chain and obsolescence messages
PartialViewTreeControllerBase.cs Removed StaticServiceProvider, updated constructor chain and obsolescence messages
SiblingsStylesheetTreeController.cs Removed StaticServiceProvider, simplified constructors
RootStylesheetTreeController.cs Removed StaticServiceProvider, simplified constructors
ChildrenStylesheetTreeController.cs Removed StaticServiceProvider, simplified constructors
AncestorsStylesheetTreeController.cs Removed StaticServiceProvider, simplified constructors
SiblingsScriptTreeController.cs Removed StaticServiceProvider, simplified constructors
RootScriptTreeController.cs Removed StaticServiceProvider, simplified constructors
ChildrenScriptTreeController.cs Removed StaticServiceProvider, simplified constructors
AncestorsScriptTreeController.cs Removed StaticServiceProvider, simplified constructors
SiblingsPartialViewTreeController.cs Removed StaticServiceProvider, simplified constructors
RootPartialViewTreeController.cs Removed StaticServiceProvider, simplified constructors
ChildrenPartialViewTreeController.cs Removed StaticServiceProvider, simplified constructors
AncestorsPartialViewTreeController.cs Removed StaticServiceProvider, simplified constructors and unused imports

@mattbrailsford
Copy link
Contributor

@AndyButland I can confirm that's back working correctly for Umbraco Forms 👍

@AndyButland AndyButland enabled auto-merge (squash) October 22, 2025 13:39
@AndyButland AndyButland merged commit 6bc498a into main Oct 22, 2025
24 of 25 checks passed
@AndyButland AndyButland deleted the v16/bugfix/resolve-backward-compatibility-for-file-system-controllers branch October 22, 2025 14:20
AndyButland added a commit that referenced this pull request Oct 22, 2025
…rollers (closes #20602) (#20608)

* Restore backward compatibility for file system based tree controllers.

* Aligned obsoletion messages.
lauraneto pushed a commit that referenced this pull request Oct 22, 2025
…rollers (closes #20602) (#20608)

* Restore backward compatibility for file system based tree controllers.

* Aligned obsoletion messages.
AndyButland added a commit that referenced this pull request Oct 24, 2025
…rollers (closes #20602) (#20608)

* Restore backward compatibility for file system based tree controllers.

* Aligned obsoletion messages.
AndyButland added a commit that referenced this pull request Oct 27, 2025
…sses to create null payloads (#20660)

* Trees: Restore backward compatibility for file system based tree controllers (closes #20602) (#20608)

* Restore backward compatibility for file system based tree controllers.

* Aligned obsoletion messages.

* Reverts nullability update on ConvertNotificationToRequestPayload.
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.

4 participants