when calling the function libraries_load(),a notice comes out.

Notice: Undefined index: installed in libraries_load() (line 604 of ....\sites\all\modules\custom\libraries\libraries.module).

i set a breakpoint in libraries_load(),i find that source is here(line 580 of libraries.module):" $library = cache_get($name, 'cache_libraries'); ",the object $library can't be get correctly,so $library->data = 0;

how can i deal with it?

thank you!

Comments

tstoeckler’s picture

580 $library = cache_get($name, 'cache_libraries');
581 if ($library) {
582 $library = $library->data;
583 }
584 else {
585 $library = libraries_detect($name);
586 cache_set($name, $library, 'cache_libraries');
587 }

I fail to see what is wrong with that code and also how $library['installed'] can not be set (it gets set unconditionally in libraries_detect()).

BTW: Why is libraries.module in your custom folder?

Marking "maintainer needs more info", but the next time I stumble on this, I will mark it "cannot reproduce". I am pretty sure this is an error on your side.

tstoeckler’s picture

Status: Active » Postponed (maintainer needs more info)

...

jzornig’s picture

I also am getting this. In my case it is because there is no version number for the library. In hook_libraries_info the 'version arguments' is not optional, but there doesn't seem to be any way to cope with a library that doesn't have a version number embedded in one of it's files.

tstoeckler’s picture

but there doesn't seem to be any way to cope with a library that doesn't have a version number embedded in one of it's files

What library is that? That seems to be an edge-case.

What you can do to solve this is simply set $library['version'] in hook_libraries_info(). The version detection will not run in that case.

jzornig’s picture

Thanks, I worked out I could just create my own version callback and set it there. Everything is working for me now.

tstoeckler’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Fixed

Great, marking fixed.
There was no response regarding the initial report, so that should be fine.

Status: Fixed » Closed (fixed)

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