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

  1. Login as User 1 (I haven't tested other users)
  2. Enable "Comment (comment)" field mapping at `/admin/config/crm/user/settings` and check "Form" and "View"
  3. Edit User 1 (e.g. `/user/1/edit`), selecting the "Open" comments radio button (whose presence doesn't really make sense), and save User
  4. 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

Issue fork crm-3573906

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jdleonard created an issue. See original summary.

bluegeek9’s picture

Assigned: Unassigned » bluegeek9

bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Active » Needs review

  • bluegeek9 committed 89988265 on 1.0.x
    feat: #3573906 Comment field mapping exposes unexpected comment settings...
bluegeek9’s picture

Status: Needs review » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM as a favorite on the project page to help others discover it and show your support.
  • Review the Developer Docs for accuracy and clarity.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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