diff --git a/modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php b/modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php index 90fe0b0..0ce8834 100644 --- a/modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php +++ b/modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php @@ -22,7 +22,7 @@ use Drupal\Core\Entity\EntityDisplayRepositoryInterface; * id = "entity_form", * label = @Translation("Entity form"), * description = @Translation("Provides entity form widget."), - * autoSelect = FALSE + * auto_select = FALSE * ) */ class EntityForm extends WidgetBase { diff --git a/src/Annotation/EntityBrowserSelectionDisplay.php b/src/Annotation/EntityBrowserSelectionDisplay.php index a729234..fe54f95 100644 --- a/src/Annotation/EntityBrowserSelectionDisplay.php +++ b/src/Annotation/EntityBrowserSelectionDisplay.php @@ -60,6 +60,6 @@ class EntityBrowserSelectionDisplay extends Plugin { * * @var bool */ - public $jsCommands = FALSE; + public $js_commands = FALSE; } diff --git a/src/Annotation/EntityBrowserWidget.php b/src/Annotation/EntityBrowserWidget.php index d8a512e..22a059a 100644 --- a/src/Annotation/EntityBrowserWidget.php +++ b/src/Annotation/EntityBrowserWidget.php @@ -45,6 +45,6 @@ class EntityBrowserWidget extends Plugin { * * @var bool */ - public $autoSelect = FALSE; + public $auto_select = FALSE; } diff --git a/src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php b/src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php index b943143..2609bd3 100644 --- a/src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php +++ b/src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php @@ -21,7 +21,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; * label = @Translation("Multi step selection display"), * description = @Translation("Shows the current selection display, allowing to mix elements selected through different widgets in several steps."), * acceptPreselection = TRUE, - * jsCommands = TRUE + * js_commands = TRUE * ) */ class MultiStepDisplay extends SelectionDisplayBase { diff --git a/src/Plugin/EntityBrowser/SelectionDisplay/NoDisplay.php b/src/Plugin/EntityBrowser/SelectionDisplay/NoDisplay.php index 6d9f914..1a1dbae 100644 --- a/src/Plugin/EntityBrowser/SelectionDisplay/NoDisplay.php +++ b/src/Plugin/EntityBrowser/SelectionDisplay/NoDisplay.php @@ -13,7 +13,7 @@ use Drupal\entity_browser\SelectionDisplayBase; * label = @Translation("No selection display"), * description = @Translation("Skips the current selection display and immediately delivers the entities selected."), * acceptPreselection = FALSE, - * jsCommands = FALSE + * js_commands = FALSE * ) */ class NoDisplay extends SelectionDisplayBase { diff --git a/src/Plugin/EntityBrowser/SelectionDisplay/View.php b/src/Plugin/EntityBrowser/SelectionDisplay/View.php index 8001cda..c9722aa 100644 --- a/src/Plugin/EntityBrowser/SelectionDisplay/View.php +++ b/src/Plugin/EntityBrowser/SelectionDisplay/View.php @@ -15,7 +15,7 @@ use Drupal\views\Views; * label = @Translation("View selection display"), * description = @Translation("Use a pre-configured view as selection area."), * acceptPreselection = TRUE, - * jsCommands = FALSE + * js_commands = FALSE * ) */ class View extends SelectionDisplayBase { diff --git a/src/Plugin/EntityBrowser/Widget/Upload.php b/src/Plugin/EntityBrowser/Widget/Upload.php index c031749..9b5493c 100644 --- a/src/Plugin/EntityBrowser/Widget/Upload.php +++ b/src/Plugin/EntityBrowser/Widget/Upload.php @@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; * id = "upload", * label = @Translation("Upload"), * description = @Translation("Adds an upload field browser's widget."), - * autoSelect = FALSE + * auto_select = FALSE * ) */ class Upload extends WidgetBase { diff --git a/src/Plugin/EntityBrowser/Widget/View.php b/src/Plugin/EntityBrowser/Widget/View.php index 1d561d8..e9794c0 100644 --- a/src/Plugin/EntityBrowser/Widget/View.php +++ b/src/Plugin/EntityBrowser/Widget/View.php @@ -23,7 +23,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; * label = @Translation("View"), * provider = "views", * description = @Translation("Uses a view to provide entity listing in a browser's widget."), - * autoSelect = TRUE + * auto_select = TRUE * ) */ class View extends WidgetBase implements ContainerFactoryPluginInterface { diff --git a/src/SelectionDisplayBase.php b/src/SelectionDisplayBase.php index 218bd94..c48137a 100644 --- a/src/SelectionDisplayBase.php +++ b/src/SelectionDisplayBase.php @@ -135,7 +135,7 @@ abstract class SelectionDisplayBase extends PluginBase implements SelectionDispl * {@inheritdoc} */ public function supportsJsCommands() { - return $this->getPluginDefinition()['jsCommands']; + return $this->getPluginDefinition()['js_commands']; } /** diff --git a/src/WidgetBase.php b/src/WidgetBase.php index 704742a..0916751 100644 --- a/src/WidgetBase.php +++ b/src/WidgetBase.php @@ -125,7 +125,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain // Check if widget supports auto select functionality and expose config to // front-end javascript. $autoSelect = FALSE; - if ($this->getPluginDefinition()['autoSelect']) { + if ($this->getPluginDefinition()['auto_select']) { $autoSelect = $this->configuration['auto_select']; $form['#attached']['drupalSettings']['entity_browser_widget']['auto_select'] = $autoSelect; } @@ -156,7 +156,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain ]; // If auto select is supported by Widget, append default configuration. - if ($this->getPluginDefinition()['autoSelect']) { + if ($this->getPluginDefinition()['auto_select']) { $defaultConfig['auto_select'] = FALSE; } @@ -215,8 +215,8 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain '#default_value' => $this->configuration['submit_text'], ]; - // Allow "auto_select" setting when autoSelect is supported by widget. - if ($this->getPluginDefinition()['autoSelect']) { + // Allow "auto_select" setting when auto_select is supported by widget. + if ($this->getPluginDefinition()['auto_select']) { $form['auto_select'] = [ '#type' => 'checkbox', '#title' => $this->t('Automatically submit selection'), @@ -354,7 +354,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain * {@inheritdoc} */ public function requiresJsCommands() { - return $this->getPluginDefinition()['autoSelect'] && $this->getConfiguration()['settings']['auto_select']; + return $this->getPluginDefinition()['auto_select'] && $this->getConfiguration()['settings']['auto_select']; } } diff --git a/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php b/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php index f7f62a5..7d19edf 100644 --- a/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php +++ b/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php @@ -12,7 +12,7 @@ use Drupal\entity_browser\WidgetBase; * id = "dummy", * label = @Translation("Dummy widget"), * description = @Translation("Dummy widget existing for testing purposes."), - * autoSelect = FALSE + * auto_select = FALSE * ) */ class DummyWidget extends WidgetBase { diff --git a/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/MultipleSubmitTestWidget.php b/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/MultipleSubmitTestWidget.php index 79bebb3..8c9db76 100644 --- a/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/MultipleSubmitTestWidget.php +++ b/tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/MultipleSubmitTestWidget.php @@ -12,7 +12,7 @@ use Drupal\entity_browser\WidgetBase; * id = "multiple_submit_test_widget", * label = @Translation("Multiple submit test widget"), * description = @Translation("Test widget with multiple submit buttons only for testing purposes."), - * autoSelect = FALSE + * auto_select = FALSE * ) */ class MultipleSubmitTestWidget extends WidgetBase {