Updated: Comment #0

Problem/Motivation

If you enable comment module from a minimal profile you don't automatically get the ability to comment on node types as it is not obvious that you need to add a field and you can't do this through the UI without enabling field UI module.
The menu item "Comment types" is used less recently then "Content types" but goes before and leads to errors (users frequently use a wrong link) and waste of time and attention.

Proposed resolution

Rename the menu item to "Commenting"

Add dependency in Comment to Field (field is required but being explicit is important).
Add a configure link to comment.info.yml pointing to admin/structure/comment
When no fields exist, make admin/structure/comment display help text along the lines of 'You have not placed a comment field on any entity types. In order to comment on another entity, you must add a comment-field to that entity.'
If field UI module is disabled append:
'To do so from the Drupal interface, you need to enable the Field UI module.'
Then if config module is enabled we can append 'Alternatively you can .'

Steps to reproduce

  1. Install minimal.
  2. Enable comment.
  3. Create a content type.
  4. Create a node.
  5. Try to comment. DOH!

Remaining tasks

  • Needs review.
  • Needs tests?

User interface changes

None.

API changes

None.

Comments

penyaskito’s picture

Status: Active » Needs review
StatusFileSize
new344 bytes

Added dependency. However, as field_ui is not installed, it won't be obvious for a user to know how to add comments.
I guess most of unexperienced people install with standard profile, so not sure if any other action should be taken.

tim.plunkett’s picture

I don't see how this is a bug, field.module is required.

larowlan’s picture

Title: Comment must depend on Field » Without Field UI comment module presents a poor UX
Issue summary: View changes
larowlan’s picture

andypost’s picture

The proper dependency makes sense in context of #2199637: Replace "required" flag of Field module with proper dependencies

The help text on "configure" route should explain the need in field_ui module

andypost’s picture

Issue tags: +revisit before release

Now we have comment type that works without "field" module...

In #1805932: Resolve menu UI issues on 'Comment fields' tab of bundle field ui pages exposed idea to use "tabs" and we actually lacks consistency to enable commenting on entities.

At the same time all the need is to provide a page that lists content entities (with integer IDs ;) and their bundles as checkboxes to "enable commenting"...
The related issues #552604: Adding new fields leads to a confusing "Field settings" form & #1963340: Change field UI so that adding a field is a separate task

There's CommentManagerInterface::addDefaultField() to add default field.

The tricky part is "disable commenting" that could be released by re-using "locked and enabled" field properties. just do not delete the fields.

Also some contextual links (probably) with modal dialogs could be used to edit and delete comment

PS: the interesting part - are we able to use comment field as base entity field...

andypost’s picture

Issue tags: +Needs tests
StatusFileSize
new8.2 KB
new23.5 KB

Initial stub for #6

Status: Needs review » Needs work

The last submitted patch, 7: 2230177-commenting-7.patch, failed testing.

larowlan’s picture

Issue tags: +Usability

Nice!

  1. +++ b/core/modules/comment/src/Form/CommentingForm.php
    @@ -0,0 +1,157 @@
    +          // Create new comment type to prevent exception.
    +          // @see \Drupal\comment\CommentManager::addDefaultField()
    +          // @todo Is there a reason of comment type for each entity type?
    +          $comment_type = 'comment_' . $entity_type_id;
    +          $this->commentManager->addDefaultField($entity_type_id, $bundle, 'comment', CommentItemInterface::OPEN, $comment_type);
    

    Yes, its so we can make the entity_id field on comment an ER field (you need to set the entity-type of the ER field, and this can only vary by bundle)

  2. +++ b/core/modules/comment/src/Form/CommentingForm.php
    @@ -0,0 +1,157 @@
    +        $this->entityManager->getStorage('field_instance_config')
    +          ->delete($comment_fields);
    

    There should be a confirm form here, along with a list of dependencies etc. As this will result in data loss.

Bojhan’s picture

I have no idea why this is doing this? We really shouldn't be creating UX hacks like this

andypost’s picture

@larowlan what do you mean with confirm form and dependencies?
@Bojhan I think 80% of users need just a simple interface to enable commenting

Bojhan’s picture

@andypost Yes, but this sounds very much like an anti-pattern. We don't have this for any of the other entities, and its basically a work around to the Field UI having such bad UX. I don't see how this helps users understand the concepts at play.

I am tempted to mark this won't fix, but it might be good if a committer chimes in. I'd rather have some help text here, than some funky custom UI.

andypost’s picture

Help texts should be added/fixed anyway in the issue, so no need to wontfix

andypost’s picture

Discussed with @catch at IRC, the suggestion to improve help texts

andypost> catch, please comment in https://www.drupal.org/node/2230177 is help text adjustments enough?
catch> andypost: generally I prefer relying on the Field UI, even if it's bad, than adding anything custom.
catch> andypost: so agree with Bojhan on adding help text.
catch> andypost: so there was a similar UX issue when taxonomy moved to a field in 7.x, but again we ended up leaving it just using Field UI.
catch> andypost: the idea being that 1. it's consistent 2. it provides some impetus to give Field UI better UX for tasks like this.

ianthomas_uk’s picture

Is the revisit before release tag appropriate on this issue? The tag is generally used for issues that can't be fixed immediately but where a fix might be possible at a later date, or where a quick hack has been implemented with the intention of removing it before release.

I don't think there are any external factors preventing this from just being fixed.

andypost’s picture

Also it's really confusing to have "comment types" in Structure menu - it always takes a time to separate them from "content types" visually and sometimes leads to extra clicks because comments goes before content

andypost’s picture

Issue summary: View changes
StatusFileSize
new32.1 KB

added screens to summary and #16

andypost’s picture

Would be great to discus around DC

xjm’s picture

Issue tags: -revisit before release +revisit before release candidate
xjm’s picture

Issue tags: -revisit before release candidate

We discussed this with @webchick, @alexpott, @catch, and @effulgentsia -- we should definitely improve the hook help entry that exists and also add text in hook_help() to be shown on this page, but it's a straightforward UX/documentation bug so no need to "revisit" it.

andypost’s picture

@xjm suppose better to re-open #2091299: Update hook_help for Comment module and move the issue to 8.1 cos it's focused on Usability of comment management
Otoh we have no such interface in d7 so it's not a regresion like #1997692: Create contact form block

So maybe discus such sort of issues as RC-polishing stage?

jhodgdon’s picture

Please open a new issue to improve the help, rather than reopening a fixed issue at this point. We do not normally want to reopen old issues that were fixed 11 months ago, to address newly discovered problems. We should open a new issue instead.

All hook_help issues should be listed with parent issue #1908570: [meta] Update or create hook_help() texts for D8 core modules please, or at least make sure that is listed as "related".

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture

Status: Needs work » Closed (duplicate)
Issue tags: +Bug Smash Initiative

The extra help text was added in #2488078: Update hook_help for Comment module about field UI need to manage comment fields. Marking this as duplicate.