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.
Symptoms/description
Upgraded to 7.x-2.2 as suggested by the system, now I get the following warnings with every page load:
Notice: Undefined index: post-load integration files in libraries_load_files() (line 697 of /home/mysite/public_html/sites/all/modules/libraries/libraries.module).
Notice: Undefined index: post-load integration files in libraries_load_files() (line 775 of /home/mysite/public_html/sites/all/modules/libraries/libraries.module).
Solution:
Clear your cache.
Go to admin/config/development/performance and click "Clear all caches"
Comment | File | Size | Author |
---|---|---|---|
#21 | 2193969.patch | 589 bytes | tstoeckler |
Comments
Comment #1
webpotato CreditAttribution: webpotato commentedComment #2
jacobkdavis CreditAttribution: jacobkdavis commentedI was having the same problem. I checked the module code and it looks like it's not checking to see if that index is set before checking if it's not true.
It could be fixed by adding an "isset" before the check. From:
if (!$library['post-load integration files'] && !empty($library['integration files'])) {
to something like:
if ((isset($library['post-load integration files']) && !$library['post-load integration files']) && !empty($library['integration files'])) {
Comment #3
cmejo CreditAttribution: cmejo commentedworked for me too, thanks!
Comment #4
deminy#2 works for me as well. Thanks
Comment #5
timkang CreditAttribution: timkang commentedThe isset() call should not be necessary, as the value should be set by default in libraries_info_defaults():
In the few sites where I've encountered this error, clearing the cache was sufficient to resolve it.
Comment #6
parijke CreditAttribution: parijke commented#2 worked for me, but following for a supported solution / patch
Comment #7
yaelo25@gmail.com CreditAttribution: yaelo25@gmail.com commentedI tried the isset thing and the line 697 was resolved but i now get a double:
notice: Undefined index: post-load integration files in libraries_load_files() (line 775 of.... message
any ideas? thanks!
Comment #8
scottzak CreditAttribution: scottzak commentedTook several cache clears, but that did eliminate the problem for me.
Comment #9
Cynthia Ewer CreditAttribution: Cynthia Ewer commentedSubscribing; experiencing the same issue.
Comment #10
yaelo25@gmail.com CreditAttribution: yaelo25@gmail.com commentedsolution was to go to line 775 in module code and replace it with the same as mentioned in #2. it solved the problem.
Comment #11
luis_mejia CreditAttribution: luis_mejia commentedI just update now libraries and has two alerts, i change the line in the module file but i still have the second alert message:
Notice: Undefined index: post-load integration files in libraries_load_files() (line 774 of /var/www/html/msco/sites/all/modules/libraries/libraries.module).
Comment #12
tsssystems CreditAttribution: tsssystems commentedClearing all caches, hitting a page, clearing all caches again, hitting another page, and clearing the caches a third time did the trick for me. Both errors gone. Don't know why it took more than one cache clearing, but it did.
Comment #13
Yazzbe CreditAttribution: Yazzbe commented#2 fixed it for me too in D7.26
Comment #14
adrianh2 CreditAttribution: adrianh2 commentedDrupal v7.26:
Per #2, adding isset( ) in lines 697 and 775 solves it for me.
Clearing the cache does not.
Comment #15
John Franklin CreditAttribution: John Franklin commentedAttached patch uses empty() to do the same thing.
Comment #16
_San_ CreditAttribution: _San_ commentedClearing the cache ~4 or 5 times fixed this for me as well.
Comment #17
david_garcia CreditAttribution: david_garcia commentedSame here, completely clearing the cache by means of update.php did the trick.
Comment #18
VirtualMitra CreditAttribution: VirtualMitra commentedI was working in Aegir and migrated a site with libraries to a new platform, when I got this same error. Using drush, I rebuilt the registry (drush rr) for the site, cleared the cache (drush cc all), and it went away.
Comment #19
labboy0276 CreditAttribution: labboy0276 commentedI created this patch based on the convos above. It seemed to work on some of our sites.
Easier then people hacking the core code.
Comment #20
gregglesComment #5 points out that the real solution here is just to clear the cache.
Updating the original post to make that more clear and changing this from a bug to a support request.
I see that the release node has a clear note on this topic. In the future if a release needs to have the cache cleared it should have a hook_update that clears the specific cache.
1. depending on how updates are executed they will clear the cache
2. it makes it so there's much less of a chance of people experiencing the problem
Comment #21
tstoecklerRe @greggles: I was always under the impression that running update.php (which should always be done as part of the module upgrade) always clears the cache. I might be mistaken, though. In any case, an explicit upgrade function is a good idea and can't really hurt.
Here's a patch that avoids the problem by just adding the default to the library definition.
Comment #23
tstoecklerMarking fixed. Please re-open if you still encounter the problem with the latest development version.
Comment #24
gregglesI think update.php (and/or drush updb) only clears the cache if there is an update hook to be run. It also clears the cache in a rather aggressive way that will cause problems for continuous deployment on a site that runs near capacity. See this issue about skipping the cache clear in updb.
Beyond that, if there's no update hook then most novice users will not see the call-to-action advising them to run update.php and most advanced users will think that it's unnecessary.
Clearing the required caches is the wave of the future ;)
Comment #26
S.Wan CreditAttribution: S.Wan commented#19 works for me well, he showed two places which needs to be fixed, line 695 and 775, both places have to be changed to the recommended code.
Many thanks.