Problem/Motivation

After installing module on Drupal 9 and heading to configuration the following error occur

Notice: Undefined property: Drupal\custom_pub\Entity\CustomPublishingOption::$publish_under_promote_options in Drupal\custom_pub\Form\CustomPublishingOptionForm->form() (line 79 of modules/contrib/custom_pub/src/Form/CustomPublishingOptionForm.php).
Drupal\custom_pub\Form\CustomPublishingOptionForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('custom_publishing_option_add_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VladimirAus created an issue. See original summary.

VladimirAus’s picture

Status: Active » Needs review
FileSize
662 bytes
jacobbell84’s picture

Hi @VladimirAus, I don't think this is the right approach to fix this. This was added as part of issue #2926168 but it looks like the config entity needed some extra work done to it or it would generate those warnings. The property_exists check shouldn't be needed, since that property should be defined 100% of the time. I attached a patch that defines that property and adds it (along with description) to the config export. Also switched that one form entry for this setting to short array syntax since I was touching it anyways.

Let me know if you have trouble applying the patch. It looks like the patch from #2 was merged into dev already, so this patch assumes that #2 has been applied before hand.

jacobbell84’s picture

FileSize
2.94 KB

Missed a reference to the publish_under_promote_options property in the main module.

VladimirAus’s picture

Status: Needs review » Reviewed & tested by the community

VladimirAus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.