Privet Kala4ek!

I've got fatal error
"Call to undefined function libraries_load()" on page admin/config/regional/language/configure

How to reproduce:

  1. Go to admin/config/regional/language/configure
  2. Enable plugin for detect language by user settings
  3. Open function locale_language_from_user() and put there "watchdog('warning', 'test error');" (just to call watchdog).
  4. Reload page admin/config/regional/language/configure
  5. Fatal error "Call to undefined function libraries_load()"

Comments

eugene.ilyin’s picture

Issue summary: View changes
eugene.ilyin’s picture

Status: Active » Needs review
StatusFileSize
new827 bytes

This patch can correct this problem

kala4ek’s picture

Status: Needs review » Fixed

Accepted with little changes, thanks a lot.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

eugene.ilyin’s picture

wdseelig’s picture

This is a curiosity question more than anything else.

I, too, was getting the "call to undefined function" error when I tried to load a library in a module that I have developed. The problem occurred when I tried to execute the libraries_load function at the top of my module [i.e. outside all of the functions], but worked fine when I put it within a function. Can somebody tell me why?

This fails:
<?php
libraries_load('somelibrary'); //Generates "call to undefined function error

function1(){
...
}

function2(){
...
}

But this succeeds:
<?php
function1(){
libraries_load('somelibrary');
...
}
function2(){ . //Doesn't need 'somelibrary'
...
}