Problem/Motivation
Error when viewing comments on Contact or User when Comments field mapped with form enabled and "Open" option selected when editing user.
Error: Call to a member function getSetting() on null in Drupal\comment\CommentForm->actions() (line 257 of core/modules/comment/src/CommentForm.php).
Drupal\comment\CommentForm->actions() (Line: 182)
Drupal\Core\Entity\EntityForm->actionsElement() (Line: 111)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 554)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 303)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 117)
Drupal\comment\CommentLazyBuilders->renderForm()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 910)
Drupal\Core\Render\Renderer->doCallback() (Line: 417)
Drupal\Core\Render\Renderer->doRender() (Line: 253)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 143)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 634)
Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
Fiber->resume() (Line: 649)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 169)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 206)
Drupal\Core\Render\Renderer->renderPlaceholder() (Line: 730)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder() (Line: 500)
Drupal\big_pipe\Render\BigPipe->Drupal\big_pipe\Render\{closure}()
Fiber->resume() (Line: 510)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders() (Line: 256)
Drupal\big_pipe\Render\BigPipe->sendContent() (Line: 116)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 403)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
Plus a warning Drupal message when viewing the comments on Contact:
Warning: Undefined array key "crm__comment" in Drupal\comment\CommentForm->actions() (line 256 of core/modules/comment/src/CommentForm.php).
Drupal\comment\CommentForm->actions() (Line: 182)
Drupal\Core\Entity\EntityForm->actionsElement() (Line: 111)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 554)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 303)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 117)
Drupal\comment\CommentLazyBuilders->renderForm()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 910)
Drupal\Core\Render\Renderer->doCallback() (Line: 417)
Drupal\Core\Render\Renderer->doRender() (Line: 253)
Drupal\Core\Render\Renderer->doRenderRoot() (Line: 143)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 634)
Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
Fiber->resume() (Line: 649)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 142)
Drupal\Core\Render\Renderer->renderInIsolation() (Line: 169)
Drupal\Core\Render\Renderer->doRenderPlaceholder() (Line: 206)
Drupal\Core\Render\Renderer->renderPlaceholder() (Line: 730)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder() (Line: 500)
Drupal\big_pipe\Render\BigPipe->Drupal\big_pipe\Render\{closure}()
Fiber->resume() (Line: 510)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders() (Line: 256)
Drupal\big_pipe\Render\BigPipe->sendContent() (Line: 116)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 403)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
Steps to reproduce
- Login as User 1 (I haven't tested other users)
- Enable "Comment (comment)" field mapping at `/admin/config/crm/user/settings` and check "Form" and "View"
- Edit User 1 (e.g. `/user/1/edit`), selecting the "Open" comments radio button (whose presence doesn't really make sense), and save User
- Observe error when viewing comments on Contact (e.g. `/crm/contact/2/comment`) or User (e.g. `/user/1`)
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
bluegeek9 commentedComment #4
bluegeek9 commentedComment #6
bluegeek9 commented