-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Stop refering to "pages" when dealing with generic records #1867
API Stop refering to "pages" when dealing with generic records #1867
Conversation
CMSMain::class . '.ACCESS', | ||
LeftAndMain::class . '.ACCESS', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMSMain doesn't even exist if you're installing silverstripe/admin without silverstripe/cms. LeftAndMain is the obvious choice here.
'category' => _t(Permission::class . '.CMS_ACCESS_CATEGORY', 'CMS Access'), | ||
'category' => _t(LeftAndMain::class . '.CMS_ACCESS_CATEGORY', 'CMS Access'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs on LeftAndMain
as it goes hand-in-hand with the one above.
$abstractClasses = [LeftAndMain::class, CMSMain::class]; | ||
$abstractClasses = [LeftAndMain::class]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is needed so that CMSMain
can be included in the left menu and have its route built.
Without this, it was the CMSPagesController
which was a very-nearly-useless subclass of CMSMain
that was used.
That class has been merged into CMSMain
so we need its menu item back
if ($publishedRecord instanceof SiteTree) { | ||
$treeTitle = CMSMain::singleton()->getRecordTreeMarkup($publishedRecord); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like new hard coupling - but this class was always intended to be used with SiteTree - or at least has really only been used with it until now in core. The SiteTree
use statement was even already there.
The coupling will be removed in silverstripe/silverstripe-cms#2950
867f32e
to
ac52d1d
Compare
ac52d1d
to
b42c820
Compare
Replaces #1837
Two commits here:
LeftAndMain
. Found this because I had to review all i18n strings inCMSMain
anyway.DataObject
class, and adds a newgetModelClass()
method toLeftAndMain
(standardises that method betweenModelAdmin
andCMSMain
and will be used extensively in the follow-up refactor cards in this epic)Issue
SiteTree
inCMSMain
silverstripe-cms#2947