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.
That is the error message I'm getting in the console. Inspecting source I see that Shadowbox is indeed not defined.
The first mention of the Shadowbox variable is at the end of my HTML.
<script type="text/javascript">
<!--//--><![CDATA[//><!--
Shadowbox.path = "/sites/all/libraries/shadowbox/";
Shadowbox.init(Drupal.settings.shadowbox);
//--><!]]>
</script>
Comment | File | Size | Author |
---|---|---|---|
#8 | shadowbox-Shadowbox_not_defined-1251518-8.patch | 505 bytes | lhguerra |
#5 | shadowbox-Shadowbox_not_defined-1251518-5.patch | 427 bytes | FrancescoQ |
Comments
Comment #1
eric-ie CreditAttribution: eric-ie commentedIt looks like it has to do with the order of embedding. The JS files are getting included after the Shadowbox.init(); call so yes Shadowbox hasn't loaded yet. If I force it to load in the header (manually included it in the html.tpl.php file) before Shadowbox.init() gets called that error goes away but... then we have an error
Uncaught ReferenceError: Drupal is not defined
So no joy with that method.
Comment #2
manfer CreditAttribution: manfer commentedThis can't be reproduced. It beta5 there were an error where the settings where being added in the footer something that made them fail and maybe this error appear but not in beta6 that you are reporting.
The only possibility I can think of is that it happened after an upgrade because of some cache problem.
In version beta6 shadowbox is loaded on header so Shadowbox should be defined.
Other possible problem is that you have an error somewhere before shadowbox is loaded that stops the loading of any following javascript. But that won't be a shadowbox issue. In this case you would need to find the other error.
Comment #3
manfer CreditAttribution: manfer commentedNo more feedback and now the code has changed so if someone faces this issue feel free to reopen it.
Comment #4
FrancescoQ CreditAttribution: FrancescoQ commentedI'm using the last stable version 7.x-3.0-rc2 and i have the same issue, in every page it says that Shadowbox is not defined: i found that changing
to
(lowercase S)
resolve the issue.
I don't know if i'm using some strange version of the shadowbox script or else, but in this way it works for me.
Comment #5
FrancescoQ CreditAttribution: FrancescoQ commentedHere's the patch to show what i've changed in the code.
Comment #6
FrancescoQ CreditAttribution: FrancescoQ commentedSorry, i've worked on the wrong branch in git don't look at that patch!
I've changed line 51 of shadowbox.module in the 7.x-3.0-rc2
Comment #7
scolepetras CreditAttribution: scolepetras commentedThank you, FrancescoQ. I had the same problem and #6 worked for me.
Comment #8
lhguerra CreditAttribution: lhguerra as a volunteer and at Taller commentedThank's, it worked for me as well, and I've created the patch to 7.x-4.x branch.
Comment #9
lhguerra CreditAttribution: lhguerra as a volunteer and at Taller commentedUpdated issue status to review last patch.
Comment #10
kylebcooke CreditAttribution: kylebcooke commentedThanks @FrancescoQ comment #6 fixed my issue!
Comment #11
ariel@easytech.com.ar CreditAttribution: ariel@easytech.com.ar commentedThanks FrancescoQ, #6 works for me too.
Comment #12
leonano CreditAttribution: leonano commentedHi,
for 7.x-4.x branch, I've also change this on line 47:
'type' => 'inline',
to this
'type' => 'setting',
Hope this help