4

I am working on a production site, moving settings from a development site for a mobile environment. However, I am receiving the above error. I can not figure out what is causing this error. It does not matter what theme I change my jquery mobile environment too. I've checked all the modules and they seem to be the same versions. The only thing I can see that is different is in the development site I can uncheck/check the block cache, on the production environment I can not do this.

9

Sounds like an issue with the ordering of the javascript files. Drupal is defined in

/misc/Drupal.js

var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} };

Check Drupal.js is added to your HTML source, prior to when that variable is requested.

1
  • 1
    Thank you for your answer. I'm not sure if that was the issue or if I was having issues with htaccess. Either way I was able to resolve the issue.
    – Cameron
    Jan 16 '13 at 22:39
4

In drupal 8 you might have to add core/drupal as a dependency of your module.

your-custom-module:
  version: 1.x
  js:
    js/your_custom_module.js: {}
  dependencies:
    - core/drupal
    - core/drupalSettings
1

I've experienced the same problem installing a drupal 7 web site from a dump.

The original default folder was provided empty for sizes management. After pushing in the settings.php file and the files directory the Drupal is not defined error was there.

Originally the developers had two other folders inside the default folder.

When restored this folders the error was solved.

0

As mentioned by @David Thomas, this is an issue with file misc/drupal.js. Drupal by default puts it into the correct order. So most likely, the file is not accessible by your web server. Create its URL and try accessing it in your browser, and you will see.

In my case, this was due to using PHP-FPM (which runs with user rights similar to mod_suphp), and forgetting that static files (`png, jpg, css, js etc.) are still served by apache2 in my case. So these needed to be world-readable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.