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.
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
Comment #1
tstoecklerI 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.
Comment #2
tstoeckler...
Comment #3
jzornig CreditAttribution: jzornig commentedI 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.
Comment #4
tstoecklerWhat 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.
Comment #5
jzornig CreditAttribution: jzornig commentedThanks, I worked out I could just create my own version callback and set it there. Everything is working for me now.
Comment #6
tstoecklerGreat, marking fixed.
There was no response regarding the initial report, so that should be fine.