In advance, I am not a coder so bear with me.
I am trying to embed a map into a page. iframe code is:
I installed and enabled this module and added it to the page basic page content type. Text format is Full HTML.
When editing the page I see the new iframe fields.
I enter:
https://www.govtrack.us/congress/members/embed/mapframe?state=ca&distric...
into the iframe URL field
I enter:
425 and 300 into the respective width and hight fields. (Also tried % values as module page seems to indicate is allowed.)
Error reported back in red is "iframes need fix width and height, only numbers are allowed"
I've tried various numeric values.
What am I doing wrong?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | iframe-fix_validators-2842758.diff | 1.23 KB | lpsolit |
Comments
Comment #2
lilDrup commentedHi,
I have the same issue with iframe module. Do you found a way to resolve it?
Thanks
Comment #3
ehamburg commentedI have not resolved the issue and have heard nothing back from the module maintainers.
I've actually moved the website this was for to another CMS. At this point Drupal 8.x for me is not a good fit for what I need and part of the reason is that module support for it is not where I need it to be.
Comment #4
lpsolit commentedThe problem is in validateWidth() where
if (!empty($me['width']) || preg_match('#^(\d+\%?|auto)$#', $me['width']))
should be
if (empty($me['width']) || !preg_match('#^(\d+\%?|auto)$#', $me['width']))
Note the wrong position of the ! operator.
I also fixed the regular expression used in validateHeight() to match the one used in validateWidth(), for consistency. I didn't fix the incorrect description which says that only fixed values are allowed. Now relative values (percentages) are also allowed, but this string appears too many times in IframeWidgetBase.php. Maybe it should be refactored a bit to avoid string duplication. :)
Comment #6
neffets commentedFixed error in validateWidth
I took the translation-proposal by LpSolit into mind and reorganized it (now only two occurences remains).