Problem/Motivation
WebformHandler and WebformVariant plugins use configuration settings. Settings stored in a plugin's configuration require developers to call ::getConfiguration() and then get/set the plugins configuration settings.
The current approach to setting a plugins configuration settings.
$handler = $webform->getHandler('options_limit_default');
$configuration = $handler->getConfiguration();
$configuration['settings']['limit_source_entity'] = FALSE;
$handler->setConfiguration($configuration);
$webform->save();Proposed resolution
Add WebformPlugingSettingsTrait w/ Interface
The new approach to setting a plugins configuration settings.
$webform->getHandler('options_limit_default')
->setSetting('limit_source_entity', FALSE);
$webform->save();Remaining tasks
- Write patch
- Run tests
- Commit patch
User interface changes
N/A
API changes
New trait and plugin methods.
- \Drupal\webform\Plugin\WebformPlugingSettingsTrait
- \Drupal\webform\Plugin\WebformPlugingSettingsInterface
- :getSettings()
- :setSettings(array $settings)
- :getSetting($name)
- :setSetting($name, $value)
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff-7-8.txt | 3.35 KB | paulocs |
| #8 | 3211832-8.patch | 22.17 KB | paulocs |
| #7 | 3211832-7.patch | 18.86 KB | jrockowitz |
| #5 | 3211832-2.patch | 16.31 KB | jrockowitz |
| #3 | 3211832-2.patch | 16.31 KB | jrockowitz |
Comments
Comment #3
jrockowitz commentedComment #4
jrockowitz commentedComment #5
jrockowitz commentedComment #7
jrockowitz commentedComment #8
paulocsI replaced some other places.
Attaching patch and interdiff. Patch must be applied in 8.x-5.x.
Comment #9
jrockowitz commentedComment #12
jrockowitz commented