silverstripe / silverstripe-cms

Silverstripe CMS - this is a module for Silverstripe Framework rather than a standalone app. Use https://github.com/silverstripe/silverstripe-installer/ to set this up.
http://silverstripe.org/
BSD 3-Clause "New" or "Revised" License
516 stars 333 forks source link

Don't hardcode `SiteTree` in `CMSMain` #2947

Open GuySartorelli opened 6 months ago

GuySartorelli commented 6 months ago

CMSMain has a tree_class configuration property which is sometimes referenced - but sometimes SiteTree is explicitly hardcoded. The hardcoded references and the assumptions about using SiteTree should be removed.

Benefits

Related

Notes

Acceptance criteria

TO DECIDE

Decision for the above: Leave that as is for now. Part of https://github.com/silverstripe/silverstripe-cms/issues/2951 will include keeping the site name being returned from CMSMain while the generic abstract class returns a generic value.

PRs

Quick cleanup PR:

This PR removes the provideI18nEntities() entry for a localisation key that was just always in the wrong place. More details are in the PR itself. It doesn't block anything so even if you have questions about this PR, please also review any other PRs below that are ready for review.

Moving Code Around PRs:

There's a bunch of stuff that CMSMain relies on which is currently only on SiteTree. This set of PRs moves most of that stuff around so that it can be reliably called on any DataObject class which has the Hierarchy extension, which is the criteria for models to be used in CMSMain.

You can see these changes in context in the "Main PRs" section

CMS 5 PRs

Reassign to Guy after merging these so they can rebase the CMS 6 PRs on top

CMS 6 PRs

Kitchen Sink CI Framework unit test failure related to https://github.com/silverstripe/silverstripe-framework/issues/11473

Reassign to Guy once these PRs are merged so they can rebase the main PRs and get those ready for the review cycle.

Main PRs:

CMS 5 PRs

TBD

Reassign to Guy after merging these so they can rebase the CMS 6 PRs on top

CMS 6 PRs

Kitchen sink CI

emteknetnz commented 3 days ago

@GuySartorelli I merged the CMS 6 ones slightly early, there's an alignment issue on SiteTree with the new badge displayed up the top:

Firefox: image

Chrome image

Could you just open a new PR to get it to vertically align

emteknetnz commented 3 days ago

Actually don't worry about this, it's an existing thing