localgovdrupal / localgov_news

Provides news articles and news listing pages for LocalGov Drupal
GNU General Public License v2.0
0 stars 2 forks source link

Fatal error trying to configure scheduled transitions on News Article nodes #51

Closed jpoesen closed 2 years ago

jpoesen commented 2 years ago

Steps to reproduce

  1. install LocalGov Workflows
  2. enable scheduled transitions for content type 'News article' at /admin/config/workflow/scheduled-transitions
  3. edit a node of the type 'News article'
  4. click the local task 'scheduled transitions' (/node/{nid}/scheduled-transitions

Expected result

Scheduled transitions config form opens

Actual result

The website encountered an unexpected error. Please try again later.

TypeError: 

Argument 1 passed to Drupal\localgov_news\NewsExtraFieldDisplay::articlePromotedStatus() must be 
an instance of Drupal\node\NodeForm, instance of Drupal\scheduled_transitions\Form\ScheduledTransitionForm given, 

called in /var/www/html/web/modules/contrib/localgov_news/src/NewsExtraFieldDisplay.php on line 161 
in Drupal\localgov_news\NewsExtraFieldDisplay::articlePromotedStatus() 
(line 210 of modules/contrib/localgov_news/src/NewsExtraFieldDisplay.php).

Drupal\localgov_news\NewsExtraFieldDisplay::articlePromotedStatus(Object) (Line: 161)
Drupal\localgov_news\NewsExtraFieldDisplay->formAlter(Array, Object, 'node_localgov_news_article_scheduled_transitions_entity_form_form') (Line: 72)
localgov_news_form_alter(Array, Object, 'node_localgov_news_article_scheduled_transitions_entity_form_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_localgov_news_article_scheduled_transitions_entity_form_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('node_localgov_news_article_scheduled_transitions_entity_form_form', Array, Object) (Line: 279)
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: 578)
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: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
andybroomfield commented 2 years ago

Confirming that also experincing the bug, so this is live issue.

andybroomfield commented 2 years ago

This relates to the promoted on newsroom psuedo field when it is part of the form display. A work around is to remove it from the form display and the scheduled transitions work again.

andybroomfield commented 2 years ago

@jpoesen If your still about let me know if PR #55 resolved the issue for you.