-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-21838 strip html tags from alerts when crm-notification-container div is not present #11797
Conversation
Can one of the admins verify this patch? |
@colemanw wanna look at this? |
test this please |
@hoegrammer Naomi the test failures look legit for this PR, it looks like the fix may not work in an Angular JS context. If you have built your civicrm instance with buildkit you maybe able to run |
It's probably also worth giving more details as to how to replicate this issue & when it arises for you (screenshots might help) |
@eileenmcnaughton I am using a Drupal dashboard module called Homebox which displays blocks on the homepage. I am using it to display some Drupal views listing activities. You can click on an activity in the list and it will open in a popup (did this by adding the class "crm-popup" when rewriting the field). The idea is for the user to have a quick look at the activity and then file it on a case using the File On Case button. This is so they can go through the list and file away the activities without having to navigate away from the dashboard. It works really well except that the message that comes up saying "Filed on case such-and-such" contains a link to the case. Because there is no |
@seamuslee001 I did not use buildkit but I have had a look at the test results and it looks like the call |
So we need to ONLY strip the html on fallback |
@eileenmcnaughton yep, that's what the PR does |
Jenkins test this please |
OK- that makes sense - I 've updated the pr description now. Can you squash the 2 commits into one. I do kinda want @colemanw to eyeball this - although @seamuslee001 might feel confident enough to merge this one as he is pretty strong on this side of the code too. |
Squashed. |
jenkins add to whitelist |
This looks great to me. Neat trick using jQuery. |
Strips html from CRM.alert when falling back to alert()
Overview
In certain contexts CRM.alert() falls back to using the standard JS alert() which does not parse HTML. So if there is any HTML in the text passed to CRM.alert() this change strips it out.
Before
Sometimes in a customised context the alert will show as a standard alert but with html in an the html tags will display as literals
After
It renders as plan text
Technical Details
When crm-notification-container div is not present it falls back to standard html. This PR alters the html in the part of the code that applies during fallback to strip html tags. Fallback occurs on a drupal page (in this example)
Comments
Anything else you would like the reviewer to note