API page: https://api.drupal.org/api/drupal/core%21modules%21user%21src%21RoleInte...

  /**
   * Role ID for anonymous users; should match what's in the "role" table.
   */
  const ANONYMOUS_ID = AccountInterface::ANONYMOUS_ROLE;

  /**
   * Role ID for authenticated users; should match what's in the "role" table.
   */
  const AUTHENTICATED_ID = AccountInterface::AUTHENTICATED_ROLE;

Is there even still a role table on D8?

And at any rate, that would be an implementation detail. Better to say that this matches the user_role entity ID.

CommentFileSizeAuthor
#5 3114545-5.patch758 bytesDeepthi kumari
#3 3114545-3.patch774 bytesDeepthi kumari

Comments

joachim created an issue. See original summary.

Deepthi kumari’s picture

Assigned: Unassigned » Deepthi kumari
Deepthi kumari’s picture

Status: Active » Needs review
StatusFileSize
new774 bytes

Applied Patch. Please review.

joachim’s picture

Status: Needs review » Needs work

Thanks for taking a look at this!

+++ b/core/modules/user/src/RoleInterface.php
@@ -13,12 +13,12 @@
+   * Role ID for anonymous users; should match "user__role" table entity_id.

I don't think we should mention tables at all, and the 'user__role' table is an entity field table that generally shouldn't be looked at.

This should say "should match the 'role' entity ID."

Deepthi kumari’s picture

Status: Needs work » Needs review
StatusFileSize
new758 bytes

Changed accordingly and applied the patch.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 2de1352f4a to 9.0.x and 8b9cefff88 to 8.9.x and aedf143eda to 8.8.x. Thanks!

Backported to 8.8.x as a docs fix.

  • alexpott committed 2de1352 on 9.0.x
    Issue #3114545 by Deepthi kumari, joachim: docs for role constants...

  • alexpott committed 28e24f8 on 8.8.x
    Issue #3114545 by Deepthi kumari, joachim: docs for role constants...

  • alexpott committed 15ed8c7 on 8.9.x
    Issue #3114545 by Deepthi kumari, joachim: docs for role constants...

Status: Fixed » Closed (fixed)

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