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

ENH Prefer dependency injection for GridFieldComponents #147

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Feb 12, 2022

GridFieldComponents packaged with silverstripe/framework are injectable as of 4.11.0 (see silverstripe/silverstripe-framework#10204)
Explicitly invoking the injector here instead of using create() allows backwards compatability with framework < 4.11.0 while ensuring dependency injection is still used from 4.11.0 onwards.
See silverstripe/silverstripe-admin#1286 for (brief) discussion of this approach vs using ::create().

@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch 2 times, most recently from 28df268 to c85b99d Compare February 12, 2022 06:01
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Require framework ^4.11 and use the ::create() syntax instead please

@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch from c85b99d to 9eecdae Compare March 3, 2022 04:47
@GuySartorelli
Copy link
Member Author

@emteknetnz Done!

@GuySartorelli GuySartorelli requested a review from emteknetnz March 3, 2022 04:48
@emteknetnz
Copy link
Member

You'll need to rebase @GuySartorelli

GridFieldComponents packaged with silverstripe/framework are injectable as of 4.11.0
@GuySartorelli GuySartorelli force-pushed the enh/gridfieldcomponents-di branch from 9eecdae to f9ba02e Compare March 3, 2022 04:52
@GuySartorelli
Copy link
Member Author

@emteknetnz Oops, good note. Rebased on 4.

@emteknetnz emteknetnz merged commit 6d56502 into silverstripe:4 Mar 3, 2022
@GuySartorelli GuySartorelli deleted the enh/gridfieldcomponents-di branch March 3, 2022 21:46
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