Use Core Comments with Tasks?

Created on 26 January 2024, 11 months ago
Updated 11 February 2024, 10 months ago

Problem/Motivation

We need to use threaded comments to follow and discuss issues related to specific Tasks. The Burndown Log is insufficient for this task and doesn't seem to work well at all in a relatively fresh D10.2 install. I'd like to just be able to add Core's comments to the Task and let it handle all that but anything involving Comment display fails to render once attached/configured. Do you have any ideas on why or how to address?

Steps to reproduce

1. Setup Burndown
2. Add a "Ticket comment" comment Type.
3. Add a "Comments" field to the Task type set to display the comment form on the same page with the comments.
4. Ensure the "Comments" field is set to be displayed in the Display View Mode.
5. Add a new Task.
6. Note that nothing associated with the comments field is displayed on the Task canonical route (/burndown/task/{id}): no comment field/label is displayed, no comments, no comment form.

I tried adding {{ content }} to the task.html.twig but while it displayed a number of fields/properties not previously visible, Comments is not among them.

Any ideas?

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DigitalFrontiersMedia
  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    Anything show in the console log?

    Best guess is this has something to do with the custom templates. But why wouldn't it show on a form then?

    I don't know enough about the inner workings of comments though.

  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    One other thought - could this be a case of the name of the custom comments field conflicting with the internal field on the content type?

    There's a lot of re-jigging to make the tabbed interface at the bottom of the task form, and it uses the value "comment". Also used is the internal field name "log".

    Try naming your field something completely differently, and see if that works.

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    There are no errors in the console log. No errors appear in the system logs when loading the task page, BUT I just checked the Watchdog/dblog and found the following hiding there, triggered whenever I originally hit the "manage display" for the Task entity with the comment field on there:

    Entity view display 'burndown_task.task.full': Component 'field_comment' was disabled because its settings depend on removed dependencies.

    Looking around, guessing it's related to πŸ› Fix access checks for bundle permissions to avoid triggering a config validation error Fixed .

  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    Appears to be a not-uncommon issue.

    On https://www.drupal.org/project/drupal/issues/3306434 πŸ› Fix access checks for bundle permissions to avoid triggering a config validation error Fixed , one of the commenters created their own comment type, and used that for their custom field, instead of using the base comment type.

    Not sure what the actual issue is though.

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    Yeah, I created "Ticket comment" comment Type. And I haven't disabled any Core modules except for BigPipe (which was listed in a JS console stack trace while trying to trackdown a different Burndown issue; will have a patch coming). And I'm pretty sure BigPipe isn't a dependency for Comment to work. So, yeah, I'm completely dumbfounded.

  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    Not sure. Don't think it's an issue with Burndown per se though.

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    Another oddity: If I delete the custom comment type and just try to add the default comment type as a field to Task, the comment type selector dropdown is empty while it's populated for Node bundles. Interestingly, adding ECK and adding a quick entity type and bundle through that, I get the same issue as with Task (see attached screenshots).

    I understand this isn't a Burndown specific issue now. But got any ideas on which direction to point me to track down a workaround/fix?

  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    This is beyond my current abilities. Maybe somebody else can weigh in?

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    Hmmmm...but if I make a custom comment type and use that with my ECK custom entity, it at least renders:

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    So there may be something about the Task entity that is preventing this since it does work on other custom entities.

  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    Tagging with the possible related issue.

  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DigitalFrontiersMedia Sarasota, FL

    As I pointed out in the OP, I already tried outputting {{ content }} and it did not work to output the comments (though I know it was picked up because other content fields were output). However, it is now working. I cannot say with 100% certainty why it is working now, although I did try some of the workarounds listed in 3306434. But I believe I was delayed in seeing which of those worked due to the output defined OOTB in burndown-task.html.twig.

    In either case, this isn't a problem with burndown per se as you theorized, and I have achieved what I needed so I'm considering this support request fulfilled. Thank you @jeremylichtman for helping me work through the potential causes. If I find the exact fix, I will note it here for others. Otherwise, closing this and hoping it may help anybody else in trying to integrate burndown into their solution.

    Thank you!

  • πŸ‡¨πŸ‡¦Canada jeremylichtman

    Glad you resolved this.

    Only thing I can think of right now is perhaps some hitch with caching after changing the template.

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

Production build 0.71.5 2024