summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongt94122018-05-03 12:46:01 (GMT)
committerSascha Grossenbacher2018-05-03 12:46:01 (GMT)
commitbe6a91c8aaa1e174d1145c3af9d49944efade49a (patch)
treee9963af7d5af30c06d3f9042ba32aa6463ce9394
parent966e1c5ad3dc668d6a0ec4421583df74d558e05f (diff)
Issue #2958622 by yongt9412, Berdir, miro_dietiker: Add a view unpublished paragraphs permission (added missing update function)
-rw-r--r--paragraphs.install11
1 files changed, 11 insertions, 0 deletions
diff --git a/paragraphs.install b/paragraphs.install
index 111665b..5592400 100644
--- a/paragraphs.install
+++ b/paragraphs.install
@@ -231,3 +231,14 @@ function paragraphs_update_8013() {
$config->set('show_unpublished', FALSE);
return t('Paragraphs can now display unpublished Paragraphs to users with the "View unpublished paragraphs" permission. Enable it on Adminstration > Configuration > Content > Paragraphs and grant to permission to use it.');
}
+
+/**
+ * Update the status field.
+ */
+function paragraphs_update_8014() {
+ // The status field was promoted to an entity key in paragraphs_update_8013(),
+ // which makes it NOT NULL in the default SQL storage, which means its storage
+ // definition needs to be updated as well.
+ $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
+ $entity_definition_update_manager->updateFieldStorageDefinition($entity_definition_update_manager->getFieldStorageDefinition('status', 'paragraph'));
+}