From 0b7e4b9624e9436ead0fbc6177ab7c62536ce813 Mon Sep 17 00:00:00 2001 From: Joachim Noreiko Date: Mon, 18 Sep 2017 16:16:05 +0100 Subject: [PATCH 1/2] Fixed crash on bundle entity add forms for bundle entities whose content entity's class implements bundleFieldDefinitions(). --- og_ui/src/BundleFormAlter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/og_ui/src/BundleFormAlter.php b/og_ui/src/BundleFormAlter.php index 07c37938d..4bc29e07d 100644 --- a/og_ui/src/BundleFormAlter.php +++ b/og_ui/src/BundleFormAlter.php @@ -148,7 +148,7 @@ protected function addGroupContent(array &$form, FormStateInterface $form_state) $form['og']['og_group_content_bundle'] = [ '#type' => 'checkbox', '#title' => t('Group content'), - '#default_value' => Og::isGroupContent($this->entityTypeId, $this->bundle), + '#default_value' => empty($this->bundle) ? FALSE : Og::isGroupContent($this->entityTypeId, $this->bundle), '#description' => empty($target_bundles) ? t('There are no group bundles defined.') : '', ]; From 2225c8e6c47e6ab96a4638e702dfd5fa8716750f Mon Sep 17 00:00:00 2001 From: Joachim Noreiko Date: Thu, 21 Sep 2017 13:17:42 +0100 Subject: [PATCH 2/2] Simplify condition. --- og_ui/src/BundleFormAlter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/og_ui/src/BundleFormAlter.php b/og_ui/src/BundleFormAlter.php index 4bc29e07d..5b86077cc 100644 --- a/og_ui/src/BundleFormAlter.php +++ b/og_ui/src/BundleFormAlter.php @@ -148,7 +148,7 @@ protected function addGroupContent(array &$form, FormStateInterface $form_state) $form['og']['og_group_content_bundle'] = [ '#type' => 'checkbox', '#title' => t('Group content'), - '#default_value' => empty($this->bundle) ? FALSE : Og::isGroupContent($this->entityTypeId, $this->bundle), + '#default_value' => $this->bundle ? Og::isGroupContent($this->entityTypeId, $this->bundle) : FALSE, '#description' => empty($target_bundles) ? t('There are no group bundles defined.') : '', ];