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.
When iFrame Resizer is activated, AJAX calls do not fire in various Admin areas such as Views UI and Rules UI. I am using jQuery Update, but having tried all other versions of jQuery I ruled it out as contributing to the error. Disabling "This site will host resizable iFrames" fixes the problem.
I'm using Drupal 7.50.
AdvAGG JS disabled.
I have "iFrame Resizer JavaScript console logging" on.
Here is the error text I get in Inspector:
Uncaught TypeError: settings.iframe_resizer_options.maxHeight.toUpperCase is not a function (iframe_resizer.js?oeui18:25)
attach @ iframe_resizer.js?oeui18:25
(anonymous function) @ drupal.js?oeui18:76
each @ jquery.js?v=1.10.2:665
Drupal.attachBehaviors @ drupal.js?oeui18:74
insert @ ajax.js?v=7.50:570
Drupal.ajax.success @ ajax.js?v=7.50:428
success @ ajax.js?v=7.50:189
fire @ jquery.js?v=1.10.2:3048
fireWith @ jquery.js?v=1.10.2:3160
done @ jquery.js?v=1.10.2:8235
callback @ jquery.js?v=1.10.2:8778
Comments
Comment #2
markdcComment #3
markdcComment #4
milodescThanks for the detailed error report.
I haven't been able to reproduce the error. I've installed the iframe resizer module and views/view ui. Even with "This site will host resizable iFrames" checked I'm able to get to the views UI.
Do you happen to have something strange in the "Maximum height of the iFrame' field?
Comment #5
markdcI left the default value of 'Maximum height' as "Infinity". However, I had a value of "600" in the 'Minimum height' field. I cleared that and made sure all other fields had their default value. The problem still occurs.
In the end if I disable "Override the default behavior of the iFrame Resizer library" the problem is resolved and all Ajax links in Views UI work again. I can live with that for now.
Comment #6
milodescThanks for the follow-up, fatmarker.
I'm not sure how i missed it the other day, but I'm now able reproduce the issue.
It has nothing to do with how you configured the settings. Just a bug with my JavaScript. I hope to have a fix later today.
Comment #8
milodescI've pushed a fix for the issue and will create a new release momentarily.
The problem:
In iframe_resizer.js, the module converts module configuration variables into JS types that the iFrame Resizer library needs. The maxHeight and maxWidth config variables were causing errors in this process.
The script was first checking if maxHeight/maxWidth was "infinity" (with any combination of lower and uppercase letters). If so, it converted "Infinity" (a string) to Infinity (the JavaScript property):
This worked fine on initial page load, but when behaviors were fired again iframe_resizer.js tried to do the conversions again. This time however, when the script was checking to see if the conversion was necessary, maxHeight and maxWidth could already be Infinity (the JS property), and therefore the toUpperCase() function couldn't run, resulting in an error.
The solution:
There is no need to run the conversions every time behaviors are run, it only needs to happen once per page load. Therefore, I moved the conversions out of Drupal behaviors and the issue was fixed. In addition, the script no longer converts to the Infinity JS property since the library accepts "Infinity".
Comment #9
milodescComment #10
milodescComment #11
markdcLooks good. Thank you!