-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SHS-5954: Social Media Footer block — allow mailto: links #1706
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codechefmarc Works great, thanks!
@ahughes3 This one is ready for you, but tugboat is over quota so no test environment available yet. As soon as some older PR's get approved and merged we'll be able to create a test link.
@cienvaras I rebuilt some of the older PRs in Tugboat which reduced their size by a few gigs and was able to get the previews for this PR built. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…humsci into SHS-5954--social-allow-mailto
@pookmish - Ready for re-review. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid else statements if possible
docroot/modules/humsci/hs_blocks/src/Plugin/Block/SocialMediaBlock.php
Outdated
Show resolved
Hide resolved
if (str_starts_with($value, 'mailto')) { | ||
if (!preg_match($mailto_regex, $value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine these two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the problems here is that if someone enters in mailto:
with an invalid email address, that case will not be caught and instead will be validated as a URL. I can change so we don't get any custom messaging for invalid mailto
links and combine if you wish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this works for me. 👍
READY FOR REVIEW
Summary
Allows
mailto:
links in addition to standard URLs for social media block.Need Review By (Date)
2025-01-08
Urgency
low
Steps to Test
/admin/structure/block
and placing the "Social Media Block" in the footer, for example.mailto:[email protected]
linkmailto
or URLs and verify there are correct error messages for the user.PR Checklist