Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
API documentation for \Drupal\Core\Session\AccountInterface::getEmail
is incorrect. When the method is called from the anonymous user (User::load(0);
, NULL
value is returned
Proposed resolution
Change/update return type and description.
Remaining tasks
Update API docs.
User interface changes
Nil
API changes
Only docs.
Data model changes
Nil
Comment | File | Size | Author |
---|---|---|---|
#26 | 2932774-25.patch | 602 bytes | harsha012 |
#10 | 2932774-10.patch | 708 bytes | gaurav.kapoor |
#7 | 2932774-7.patch | 644 bytes | neelam.chaudhary |
Comments
Comment #2
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedDid the required changes.
Comment #3
dpiThe short comment should not wrap. One line only.
return comment should specify what happens when there is no address.
Comment #4
neelam.chaudhary CreditAttribution: neelam.chaudhary as a volunteer and at Publicis Sapient commentedFixing #3 points.
Comment #5
mohit1604 CreditAttribution: mohit1604 as a volunteer commentedComment #6
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedThanks, neelam.chaudhary for the patch #4.
Comment #7
neelam.chaudhary CreditAttribution: neelam.chaudhary as a volunteer and at Publicis Sapient commented@Mohit Malik Please do not delete or hide the patch if its working fine.
Adding the patch again as Mohit has hide the patch.
Comment #8
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commented@neelam.chaudhary Thanks for the patch mam ! . Patch was hidden/delete by mistake due to some network issues !
Comment #9
larowlanThe email field is now optional too, so this can return NULL for more than the anonymous users. Can we update this to reflect that? Possibly
The email address, or NULL if the account is anonymous or the user does not have an email address
Comment #10
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedDid changes as per suggestion in #10.
Comment #11
jeetendrakumar CreditAttribution: jeetendrakumar as a volunteer and at HyTechPro.com commentedComment #12
jeetendrakumar CreditAttribution: jeetendrakumar as a volunteer and at HyTechPro.com commentedPatch is working find for me
Changing status to RTBC
Comment #13
larowlanCan we make this 'if it exists'
Sorry for being pedantic.
Comment #14
BerdirDo we even need to change that line when we have the explicit documentation on the @return? I'd vote to just leave that initial line unchanged, seems enough to have that below?
Comment #15
larowlanAgree, that is much simpler
Comment #16
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedAdding a patch based on suggestions in #14.
Comment #17
BerdirYes, that is enough I think.
Comment #18
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed nit pick
Comment #19
jeetendrakumar CreditAttribution: jeetendrakumar as a volunteer and at HyTechPro.com commented@Berdir
I think #18 patch have right documentation.
Comment #20
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commented@harsha012
This change isn't required
And which nitpick did you fix in #18?
Comment #22
larowlanPatch #16 is the correct one
Comment #23
larowlanAdding review credit for
this needs to be string|null, not string|NULL, for coding standards.
For whoever rerolls this, please use patch 16, not 18
Comment #24
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedplease see comment #26
Comment #25
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #26
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed the nit picks as per #23
Comment #27
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedSince all the concerns have been addressed changing to RTBC.
Comment #28
larowlanRemoving myself from issue credits
Comment #30
larowlanCommitted as 354462c and pushed to 8.5.x
Leaving at RTBC and changing to 8.4.x.
Will cherry-pick to 8.4.x tomorrow after commit freeze for 8.4.4 is over.
Comment #31
larowlaninventing a tag for myself
Comment #34
larowlanCherry-picked as 4364f36 and pushed to 8.4.x.
Comment #36
larowlanAs per https://www.drupal.org/core/release-cycle-overview#current-development-c... 8.4 is in 'critical fixes only', so I reverted this from 8.4