Closed (works as designed)
Project:
Grammar Parser Library
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2012 at 21:41 UTC
Updated:
19 Feb 2013 at 15:55 UTC
the GPLIB module makes a call to a function called libraries_load("grammar_parser") in the following snippet of code found in gplib.install at around line 75:
$info = gplib_libraries_info();
$info = $info['grammar_parser'];
$keys = array_keys($info['versions']);
$version = reset($keys);
$url = l('here', $info['download url']);
$message = $t('Install version @version of the Grammar Parser library code (from !url) in a libraries directory such as "sites/all/libraries." For easy installation, use the drush make file in the Grammar Parser Library project.', array('@version' => $version, '!url' => $url));
$info = libraries_load('grammar_parser');
if (!$info['loaded']) {
the problem with this is that that function is conditionally defined in the coder_upgrade module's utility.inc file at line 44:
if (!function_exists('libraries_load')) {
function libraries_load($name, $variant = NULL) {
if (!isset($name) || $name != 'grammar_parser') {
return FALSE;
}
$library = $name;
$ext = 'inc';
foreach (array('parser', 'reader', 'writer', 'editor', 'list', 'object') as $name) {
drupal_load_include($ext, $library, "engine/$name", 'library');
}
return TRUE;
}
}
this means that GPLIB needs a dependency on CODER_UPGRADE. The problem with that is that CODER_UPGRADE has a dependency on GPLIB. that makes this module impossible to install and use since they each depend on each other.
out of curiosity why is 'libraries_load' even something used given that the libarary api is a module that appears to serve the function you are after?
Comments
Comment #1
andrewfn commentedOn upgrading this module to 7.x-1.1 I am getting the error:
Call to undefined function libraries_load() in grammar_parser_lib/gplib.install on line 82every time I look at reports / status, together with a white screen of death.
It looks like it is the code above that is generating the error.
However, I do have
coder_upgradeinstalled.Comment #2
solotandem commented@netw3rker
First, issue queue etiquette dictates that you refrain from labeling something a bug, especially a critical one, in the absence of evidence. If this code does not work, then how is it the site at http://upgrade.boombatower.com (which uses this code) has been run thousands of times? And, http://api.drupal.org is built upon it as well?
this means that GPLIB needs a dependency on CODER_UPGRADE. The problem with that is that CODER_UPGRADE has a dependency on GPLIB. that makes this module impossible to install and use since they each depend on each other.
Your conclusion is false. Do you have the libraries module enabled? If so, then 'libraries_load' is defined in it and called upon if you run coder_upgrade as part of the Drupal process (as opposed to a separate PHP process -- this is a setting). Have you noticed the other functions conditionally defined in coder_upgrade module's utility.inc file? They are defined in core. So, would you conclude the same circular dependency between core and coder_upgrade because of them?
out of curiosity why is 'libraries_load' even something used given that the libarary api is a module that appears to serve the function you are after?
Precisely, this module is the glue that requires use of the Libraries API module with Coder Upgrade, API, and other projects. The libraries_load function is in the Libraries API module.
@andrewfn, read comments above. In particular, do you have the Libraries API module enabled? It is a dependency for this module, so you should not be able to install this module without it.
Comment #3
solotandem commentedChanging status based on lack of follow up.
Comment #5
cherie.lee commentedI am so confused... I also have this problem also "
Call to undefined function libraries_load() in grammar_parser_lib/gplib.install on line 82" and I do not see a solution here to fix this!!! I have searched all over the internet but this is obviously a new bug with no fix yet. Using drupal-7.19.
Comment #6
cherie.lee commentedI am so confused... I also have this problem also "
Call to undefined function libraries_load() in grammar_parser_lib/gplib.install on line 82" and I do not see a solution here to fix this!!! I have searched all over the internet but this is obviously a new bug with no fix yet. Using drupal-7.19.
Comment #7
solotandem commentedWhat versions of this module and libraries do you have installed and in what locations beneath the drupal root? The README on either version of this module explains the need for 2.x version of libraries. Are you able to run the drush make file? If not, at least read the make file to see what versions it is after.
Comment #8
netw3rker commented@solotandem
thanks for the issue queue etiquette lesson, I'm obviously new to this whole 'drupal' thing.
A possible reason why both of those sites are unaffected by this bug is that you built them, or they were built before the coupled scenario took place. its obviously really easy to develop modules in tandem with each other and create a situation where upgrading into a tightly coupled scenario.
That being said, the libraries dependency is noted and the libraries 2.x + does appear to be what bit me. An important thing to note is that having libraries 1.x doesn't prevent you from enabling this module, even if you have the following in your info file:
might i suggest that a hook_install and hook_upgrade_n catch be put in place that warns users that their site is boned if they dont upgrade to libraries 2.x?
Comment #9
solotandem commented@netw3rker, if what you say is correct about having libraries 1.x installed doesn't prevent you from enabling this module, then that is a core bug, not a bug in this module. Your suggestion to add a couple of hook implementations to "warn users" would have to be done by every module that runs into similar circumstances. It seems clear that every module should not take that course of action, but that core should be fixed (if indeed the problem exists). I am also unclear as to the specifics of the "coupled scenario" you refer to.
@cherie.lee, without some details as to the environment you are trying to implement this in, I can not offer any guidance. I can assure you this module and the others will install and run properly if you follow the instructions in the README or use drush make with the make file.
Unless someone can provide details on how to recreate this problem and demonstrate it is an issue with this module (and not core or some other module), then I am changing status as indicated.