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>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eric-ie’s picture

It 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.

manfer’s picture

Status: Active » Postponed (maintainer needs more info)

This 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.

manfer’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No more feedback and now the code has changed so if someone faces this issue feel free to reopen it.

FrancescoQ’s picture

Version: 7.x-3.0-beta6 » 7.x-3.0-rc2
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I'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

<script>
          Shadowbox.path = "/sites/all/libraries/shadowbox/";
</script>

to

<script>
          shadowbox.path = "/sites/all/libraries/shadowbox/";
</script>

(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.

FrancescoQ’s picture

Here's the patch to show what i've changed in the code.

FrancescoQ’s picture

Sorry, 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

        'group' => JS_THEME,
        'data' => '
          shadowbox.path = "' . base_path() . $shadowbox_location . '/";
        ',
      ),
scolepetras’s picture

Thank you, FrancescoQ. I had the same problem and #6 worked for me.

lhguerra’s picture

Thank's, it worked for me as well, and I've created the patch to 7.x-4.x branch.

lhguerra’s picture

Version: 7.x-3.0-rc2 » 7.x-4.x-dev
Status: Active » Needs review

Updated issue status to review last patch.

kylebcooke’s picture

Thanks @FrancescoQ comment #6 fixed my issue!

ariel@easytech.com.ar’s picture

Thanks FrancescoQ, #6 works for me too.

leonano’s picture

Hi,
for 7.x-4.x branch, I've also change this on line 47:
'type' => 'inline',
to this
'type' => 'setting',

Hope this help