-
Notifications
You must be signed in to change notification settings - Fork 111
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
ENH Update status flags generally, not just for SiteTree #909
ENH Update status flags generally, not just for SiteTree #909
Conversation
* | ||
* @param array $flags | ||
*/ | ||
protected function updateStatusFlags(&$flags) |
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.
Nothing here is specific to SiteTree anymore. This is now split up between FluentExtension
and FluentVersionedExtension
along with the methods called from here.
/** | ||
* Update status flags based on whether the current record is exists in the current locale. | ||
*/ | ||
protected function updateStatusFlags(array &$flags): void |
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.
See FluentSiteTreeExtension
for where this code originated.
* | ||
* @param array $flags | ||
*/ | ||
protected function updateStatusFlags(array &$flags): void |
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.
See FluentSiteTreeExtension
for where this code originated.
* @param DBField|null $badgeField | ||
* @see VersionedGridFieldItemRequest::Breadcrumbs() | ||
*/ | ||
protected function updateBadge(&$badgeField) |
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.
That hook doesn't exist anymore - this is now handled through generalised status flag rendering in core.
* @param ArrayList $breadcrumbs | ||
* @see CMSMain::Breadcrumbs() | ||
*/ | ||
protected function updateBreadcrumbs(ArrayList $breadcrumbs) |
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 is now handled through generalised status flag rendering in core.
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.
I've tried rerunning tests after merging everything else, there are CI failures
fc40b0a
to
0113c90
Compare
Updated status flag tests and added a little more coverage than was already there. |
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.
Seems to do what it's supposed to do
silverstripe/silverstripe-framework#11460 makes the
updateStatusFlags()
extension hook available for all models. In combination with other PRs linked in the below issue, status flag rendering has now been standardised.This PR updates fluent to add fluent status flags to any fluent model, not just
SiteTree
, and removes custom code that renders flags in places likeLeftAndMain
breadcrumbs, gridfield edit form breadcrumbs, and gridfield rows. Those are all handled in core now.Please note that this PR relies on silverstripe/silverstripe-framework#11460 along with others.
Please do not merge this PR until all dependent PRs have been merged.
Looks like this in CMSMain:
![Screenshot from 2024-11-20 14-56-20](https://private-user-images.githubusercontent.com/36352093/387910429-6dc4bdcf-d1f9-45ff-93a3-944601f42dd7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODIzNjIsIm5iZiI6MTczOTI4MjA2MiwicGF0aCI6Ii8zNjM1MjA5My8zODc5MTA0MjktNmRjNGJkY2YtZDFmOS00NWZmLTkzYTMtOTQ0NjAxZjQyZGQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDEzNTQyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4MzNjZGQ2ZTU2NThlOTY4ZTEyMjdmZTk3NDU5NDU3MGIwZmNhYzY1NDkyODI0Y2MyMDY4ZDljZTFiY2UwNWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pVLRFlgO14MmuSpdnHjKMv7vU0WDUbrAWL9S4eLZ6lM)
Looks like this in gridfield (yes that is a gridfield holding pages, no it is not CMSMain):
![image](https://private-user-images.githubusercontent.com/36352093/387910777-fcd7babe-a9a3-458c-9336-82de46bd520e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODIzNjIsIm5iZiI6MTczOTI4MjA2MiwicGF0aCI6Ii8zNjM1MjA5My8zODc5MTA3NzctZmNkN2JhYmUtYTlhMy00NThjLTkzMzYtODJkZTQ2YmQ1MjBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDEzNTQyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwYWRjNDUzOTE2NDhkODRlYmQ4MjliMGFhN2VkZTZkYzBiODY1MzIzZmQzNDQzZWU2NDJiY2VkYjVlOGM5YTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TK7w-KrzS1IbBbprDXTrZMMEtLz6FVGkrOqnxfdugGg)
![image](https://private-user-images.githubusercontent.com/36352093/387910827-ef3ace59-064d-400a-a3eb-ded8f63e16b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODIzNjIsIm5iZiI6MTczOTI4MjA2MiwicGF0aCI6Ii8zNjM1MjA5My8zODc5MTA4MjctZWYzYWNlNTktMDY0ZC00MDBhLWEzZWItZGVkOGY2M2UxNmI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDEzNTQyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhZDY1ODJkZDAyZjI3YWYxYmY5MWY4MTg5Y2E1MGZmOTdlNmM2MWYyZTZkNzE0NTFhZDgyOTZiODRjNWU1YTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LGIvoqCzxyTTVL0tLuBoXEc3WVS_FRcu8k3QYeFkcOs)
Issue
SiteTree
inCMSMain
silverstripe/silverstripe-cms#2947