Problem/Motivation
#2433281: Move Role Constants on to a Class/Interface deprecates DRUPAL_ANONYMOUS_RID and DRUPAL_AUTHENTICATED_RID for removal some time before the 9.0.0 release.
Also the whole point of a file named 'boostrap.inc' is that you shouldn't have dependencies, such as AccountInterface.
Proposed resolution
Remove them.
Remaining tasks
Add change record.
User interface changes
API changes
Removes constants from bootstrap.inc.
Data model changes
Original issue:
#935062: Change role id to machine name changed DRUPAL_ANONYMOUS_RID and DRUPAL_AUTHENTICATED_RID to *_ROLE and the value of the constants are 'anonymous_user' and 'authenticated_user'. Since the purpose of the constants was increased readability (over 0 and 1), this purpose is now obviously defeated.
Ergo, kill them!
Comments
Comment #1
blueminds commentedWhy is this postponed? Still relevant?
Comment #2
mgiffordconst DRUPAL_AUTHENTICATED_RID = 'authenticated';is still in bootstrap.incPostponed doesn't make much sense. The issue summary is confusing too.
Comment #3
nitesh pawar commentedComment #5
mglamanThis shouldn't be edited.
Looks like patch was generated backwards?
Comment #6
nitesh pawar commentedPls Ignore this patch..
Comment #7
nitesh pawar commentedComment #8
AbdealiJK commentedI notice that now *_ROLE is deprecated in 8.0.x and for now it is set at AccountInterface::ANONYMOUS_ROLE and AccountInterface::AUTHENTICATED_ROLE.
So, is this task still valid ?
Currently, AccountInterface::AUTHENTICATED_ROLE is set as "authenticated" and AccountInterface::ANONYMOUS_ROLE as "anonymous"
Comment #9
mile23Really giving me a headache in terms of autoloading on behalf of Drupal.
I think this could happen before 8.1.x, but I'm not sure if it's an API change.
I found this change record which tells you to use these constants, even though it's clear they should go: https://www.drupal.org/node/1619504
Edited that change record in light of #2433281: Move Role Constants on to a Class/Interface
Here's a review of #6 even though it says to ignore. :-)
The test seems to pass after simply removing the constants, so core seems to no longer be using these constants.
Also remove the docblocks, please.
Comment #10
mile23Comment #11
mile23Comment #12
hussainwebI think the patch in #6 shows that we can remove the constants. I am removing them now.
Also, this seems like a BC break. I am not sure if this can go to D8.1. I will let the maintainers decide that.
Comment #13
claudiu.cristeaHey, we cannot remove global constants, they might be used in existing contrib or custom modules and themes. They ar deprecated to be removed in 9.0.x.
Comment #14
catchDuplicate of #2716163: [META] Remove deprecated classes, methods, procedural functions and code paths outside of deprecated modules on the Drupal 9 branch.