- Issue created by @wim leers
- Status changed to Needs review
about 1 year ago 9:16am 15 October 2023 - last update
about 1 year ago 221 pass, 3 fail The last submitted patch, 2: 3394172-2.patch, failed testing. View results β
- Status changed to Needs work
about 1 year ago 6:17pm 2 November 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Introduce a new #config_target Form API property to make it super simple to use validation constraints on simple config forms, and adopt it in several core config forms Fixed landed and massively simplified things! π€©
So let's adopt this in a contrib module β¦ this one π€
It was mostly easy, but it's less obvious how to port the custom UI that presents 3 simple choices to the end users, but configures a bunch of trickier things under the hood. Specifically, it's not clear how to port:
protected static function copyFormValuesToConfig(Config $config, FormStateInterface $form_state): void { β¦ // Vertical tab: 'Mapping'. if ($form_state->getValue(['mapping', 'type']) === 'simple') { // Only the 'extensions' condition is supported in this UI, to KISS. if ($simple_mapping['extensions_condition_toggle'] === 'limited') { // Set the 'extensions' condition unconditionally. $config->set('mapping.conditions.extensions', explode(' ', trim($simple_mapping['extensions_condition_value']))); } // Plus one particular common preset: 'nocssjs', which means all files // except CSS and JS. elseif ($simple_mapping['extensions_condition_toggle'] === 'nocssjs') { $config->set('mapping.conditions', static::CONDITIONS_PRESET_NOCSSJS); } else { // Remove the 'not' or 'extensions' conditions if set. $conditions = $config->getOriginal('mapping.type') === 'simple' ? $config->getOriginal('mapping.conditions') : []; if (isset($conditions['not'])) { unset($conditions['not']); } if (isset($conditions['extensions'])) { unset($conditions['extensions']); } $config->set('mapping.conditions', $conditions); } } β¦ }
- Status changed to Needs review
about 1 year ago 9:31am 3 November 2023 - last update
about 1 year ago Build Successful - last update
about 1 year ago Build Successful - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Cleanup.
End result:
cdn_ui/src/Form/CdnSettingsForm.php | 145 ++++++++++++++++++++++++++++++++++++++++----------------------------------- 1 file changed, 78 insertions(+), 67 deletions(-)
β¦ but that's largely due to much more comments.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Doing this work uncovered a core bug/regression introduced by π Introduce a new #config_target Form API property to make it super simple to use validation constraints on simple config forms, and adopt it in several core config forms Fixed : π Follow-up for #3382510: FormStateInterface::setErrorByName() needs not #name but a variation Closed: duplicate .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
And one more bug: π ConfigFormBase + validation constraints: support composite form elements Needs review .
- Status changed to Postponed
about 1 year ago 11:01am 3 November 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
The CDN module has been using validation constraints for years, but it only did so for A) things in the UI, B) things I knew once caused bug reports.
This gets us to 100% config validatability.
- last update
about 1 year ago 220 pass, 5 fail - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Follow-up for #3382510: FormStateInterface::setErrorByName() needs not #name but a variation Closed: duplicate was merged into π ConfigFormBase + validation constraints: support composite form elements Needs review .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
FYI: discussion about this at https://drupal.slack.com/archives/C2THUBAVA/p1699266350427109
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Forgot the interdiff π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Now moved the core patch from #13 into the core issue queue at #3398982-9: ConfigFormBase + validation constraints: support composite form elements β .
- π¬π§United Kingdom alexpott πͺπΊπ
Wim Leers β credited alexpott β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Update to stay in sync with #3398982-25: ConfigFormBase + validation constraints: support non-1:1 form element-to-config property mapping again β , where I implemented @alexpott's suggestion.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Note: π Allow all callables in ConfigTarget Fixed will allow making #17 far less verbose π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Update for π Allow all callables in ConfigTarget Fixed , since that's also in now!
Far less verbose π€©
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Comment tweak because π ConfigFormBase + validation constraints: support composite form elements Needs review now is always passing
FormState
as the second parameter. - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#3398982 landed!
A new
4.1.x
branch only makes sense after π Adopt GitLab CI: PHPStan compliance + test against 9.5/10.0/10.1/10.2/11.x + max PHP version Fixed is done. - Status changed to Active
about 1 year ago 11:04am 22 December 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Per #3421351-8: 5.x to require PHP 8.3 and >=10.3: bump requirements + fix deprecations β :
10.3
added some crucial infrastructure,10.2
alone does not get us far enough. - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π± 5.x requiring PHP 8.2 and >=10.2, 6.x requiring PHP 8.3 and >=11? Or skip that 5.x? Active is in, rebasing on top of that, to start seeing the actual failures instead of out-of-scope D10-to-11 trivialities.
- Issue was unassigned.
- Status changed to RTBC
8 months ago 11:59pm 2 May 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This is both more thorough than the validation ever was and friendlier for the end user!
I'm satisfied with where this has arrived.
(I'm less satisfied with the anticipation of complex CDN configurations that likely nobody ever used β¦ and now I'm carrying forward the internal complexity for that π )
- Status changed to Fixed
8 months ago 7:43am 3 May 2024 -
Wim Leers β
committed db4111bb on 5.x
Issue #3394172 by Wim Leers, alexpott: Adopt Drupal core 10.3 config...
-
Wim Leers β
committed db4111bb on 5.x
Automatically closed - issue fixed for 2 weeks with no activity.