Skip to content
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 Use dynamic config for ModalController forms #3029

Merged

Conversation

GuySartorelli
Copy link
Member

Remove redundant extension in favour of new functionality in ModalController

Relies on changes in silverstripe/silverstripe-admin#1860

Issue

@GuySartorelli GuySartorelli marked this pull request as draft November 25, 2024 04:37
const sectionConfigKey = 'SilverStripe\\CMS\\Controllers\\CMSPageEditController';
const sectionConfigKey = 'SilverStripe\\Admin\\LeftAndMain';
Copy link
Member Author

Choose a reason for hiding this comment

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

LeftAndMain now dynamically lists all link forms registered with ModalController.link_modal_form_factories

These do get inherited, so CMSPageEditController would still work, but it seems sensible to use the more generic controller here (especially since CMSPageEditController is not long for this world)

Comment on lines -46 to -51
'editorInternalLink' => [
'schemaUrl' => $modalController->Link('schema/editorInternalLink'),
],
'editorAnchorLink' => [
'schemaUrl' => $modalController->Link('schema/editorAnchorLink/:pageid'),
],
Copy link
Member Author

Choose a reason for hiding this comment

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

These get included in LeftAndMain::getClientConfig() now instead.

$pageIDField->setValue((int)$context['PageID']);
$pageIDField->setValue((int)$context['ItemID']);
Copy link
Member Author

Choose a reason for hiding this comment

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

This was changed to be more generic so we can reuse it in other link forms if needed.

@GuySartorelli GuySartorelli force-pushed the pulls/6/modal-controller branch from 1738a21 to a760dfe Compare November 27, 2024 00:17
@GuySartorelli GuySartorelli marked this pull request as ready for review November 27, 2024 00:25
@emteknetnz emteknetnz merged commit 7c5e243 into silverstripe:6 Nov 27, 2024
11 of 13 checks passed
@emteknetnz emteknetnz deleted the pulls/6/modal-controller branch November 27, 2024 04:12
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.

2 participants