diff --git a/config/install/paragraphs.settings.yml b/config/install/paragraphs.settings.yml index 52e67b1..ed1800d 100644 --- a/config/install/paragraphs.settings.yml +++ b/config/install/paragraphs.settings.yml @@ -1 +1,2 @@ show_unpublished: true +allow_reference_changes: false diff --git a/config/schema/paragraphs.schema.yml b/config/schema/paragraphs.schema.yml index e6cf733..954bd8f 100644 --- a/config/schema/paragraphs.schema.yml +++ b/config/schema/paragraphs.schema.yml @@ -4,3 +4,6 @@ show_unpublished: type: boolean label: 'Allow users with "View unpublished paragraphs" permission to see unpublished paragraphs.' + allow_reference_changes: + type: boolean + label: 'Allow reference changes for paragraphs.' diff --git a/src/Plugin/Field/FieldWidget/ParagraphsWidget.php b/src/Plugin/Field/FieldWidget/ParagraphsWidget.php index 34d82e4..8ee2249 100644 --- a/src/Plugin/Field/FieldWidget/ParagraphsWidget.php +++ b/src/Plugin/Field/FieldWidget/ParagraphsWidget.php @@ -2508,7 +2508,7 @@ * TRUE if we can allow reference changes, otherwise FALSE. */ protected function allowReferenceChanges() { - return !$this->isTranslating; + return !$this->isTranslating || \Drupal::configFactory()->getEditable('paragraphs.settings')->get('allow_reference_changes'); } /**