Closed (fixed)
Project:
Simple Google Maps
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Dec 2017 at 10:33 UTC
Updated:
1 Jan 2018 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eric heydrichCreated a patch
Comment #3
jhodgdonThis issue is a duplicate, but is marked for Drupal 7, so I'll just mark them as Related.
Comment #4
jhodgdonComment #5
jhodgdonI reviewed the patch, and it seems mostly OK, but I ... Given that there is already a proposed Drupal 7 patch on the other issue, I think it would be a good idea if the Drupal 8 patch were more similar, especially where the Drupal 7 patch is I think a little better. Here are some things I think need to be fixed in this patch:
a) Call the new config element iframe_title, not just title. [It seems like "title" is quite ambiguous. Could be the title of the section the maps are in, the title of a link, etc.]
b) In the settings form, the D7 patch has:
This seems better than the settings form in this patch.
c) The D7 patch has the ability to embed the address as part of the title (see patch on #2902178-15: Add title attribute to iframe (7.x).
d) In the patch here, the iframe title hasn't been added to the settings summary. It should be.
e) The schema YML file is missing a newline at the end in this patch.
Comment #6
eric heydrichComment #7
eric heydrichI've implemented all mentioned points from #5 in this patch.
Comment #8
eric heydrichCorrected some coding standard errors.
Comment #9
eric heydrichCorrected some coding standard errors.
Comment #10
martin107 commented@Eric Heydrich
Thanks for working on this ... yes A11y is a difficult thing to do correctly.
I think you are correct and title should be corrected. so +1 on the issue in general.
[ it is good to have another pair of eyes looking at this.]
I have a minor nit and then a catchability issue.
looking at the so life cycle of 'iframe_title'
a) Defined as a string in the schema.
b) Defaults to empty string in SimpleGMapFormatter:defaultSettings()
The inconsistency then is that the default theme/twig variable iframe_title defined in simple_gmap_theme() should also be a empty string and not NULL. ( that way conceptually it is a string all the way through )
Here are my step to reproduce the catchability issue - found during manual testing.
Adjust the formatter form to be "[address]" so I could test that if a hacker inputs a malicious SCRIPT tag as the title then sanitization will mangle the SCRIPT tag into the harmless form ( this test passes - as expected but hey just checking )
The catchability issue comes from the fact that when I returned to the formatter form and changed the iframe title to something stupid like 'socks' the catchability issue becomes apparent.. instead of socks the munged script tag was still displayed.
So we need a cache invalidation strategy - in the general sense as actually any change to the formatter config( say width ) needs to trigger a cache invalidation.
As to the way forward here I am flexible there are many valid ways to proceed.
Create a cache bubbling issue ? ( probably best dealt with separately - I will try and find time to do that next week )
That is a module wide issue and a bug that has existed for a long time ... so I am happy to move this issue to RTBC once the NULL nit is corrected.
@jhodgdon in the interests of efficiency .. if you are happy .. move this to RTBC and I will fix the NULL nit on commit.
Comment #11
jhodgdonIs that cache problem true for any change to the settings? I would have thought that Drupal Core would take care of invalidating the cache if any settings on any field formatters were changed. It seems crazy that each field formatter would need to take care of it. ?!? Weird.
Anyway, the patch is fine from my point of view. Seems like you've tested it, and are ready for RTBC so I'll go ahead and change the status. I need to do something with the 7.x patch too...
Comment #13
martin107 commentedThank you both for taking the time to look at this...
Spawned a few side issues and fixed the NULL issue on commit.
Comment #14
martin107 commented@jhodgdon.. sorry for seeming a little rude... you questions in #11 have not gone unnoticed ...
I will answer them directly in #2931580: Cache invalidation stratergy
Comment #15
jhodgdonNo worries, I wasn't feeling bad about this. :)