I have added boost as a dependency to my installation profile, but when the Drupal installer starts installing Boost, it throws an error. Without Boost as dependency, the installation profile works fine. Also, enabling Boost after works great.
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://example.com/install.php?profile=example&locale=fr&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 0, 1; Array ( ) in menu_get_item() (line 443 of /home/user/Public/Sites/examplesite/includes/menu.inc).
The function in menu.inc is below, with line 443 being the following: $router_item = db_query_range('SELECT * FROM {menu_router} WHERE path IN (:ancestors) ORDER BY fit DESC', 0, 1, array(':ancestors' => $ancestors))->fetchAssoc();
function menu_get_item($path = NULL, $router_item = NULL) {
$router_items = &drupal_static(__FUNCTION__);
if (!isset($path)) {
$path = $_GET['q'];
}
if (isset($router_item)) {
$router_items[$path] = $router_item;
}
if (!isset($router_items[$path])) {
$original_map = arg(NULL, $path);
// Since there is no limit to the length of $path, use a hash to keep it
// short yet unique.
$cid = 'menu_item:' . hash('sha256', $path);
if ($cached = cache_get($cid, 'cache_menu')) {
$router_item = $cached->data;
}
else {
$parts = array_slice($original_map, 0, MENU_MAX_PARTS);
$ancestors = menu_get_ancestors($parts);
$router_item = db_query_range('SELECT * FROM {menu_router} WHERE path IN (:ancestors) ORDER BY fit DESC', 0, 1, array(':ancestors' => $ancestors))->fetchAssoc();
cache_set($cid, $router_item, 'cache_menu');
}
if ($router_item) {
// Allow modules to alter the router item before it is translated and
// checked for access.
drupal_alter('menu_get_item', $router_item, $path, $original_map);
$map = _menu_translate($router_item, $original_map);
$router_item['original_map'] = $original_map;
if ($map === FALSE) {
$router_items[$path] = FALSE;
return FALSE;
}
if ($router_item['access']) {
$router_item['map'] = $map;
$router_item['page_arguments'] = array_merge(menu_unserialize($router_item['page_arguments'], $map), array_slice($map, $router_item['number_parts']));
$router_item['theme_arguments'] = array_merge(menu_unserialize($router_item['theme_arguments'], $map), array_slice($map, $router_item['number_parts']));
}
}
$router_items[$path] = $router_item;
}
return $router_items[$path];
}
Comment | File | Size | Author |
---|---|---|---|
#15 | boost-installation-profile-1069922-15.patch | 826 bytes | mikeytown2 |
#7 | boost-1069922.patch | 748 bytes | mikeytown2 |
#4 | boost-1069922.patch | 1.17 KB | mikeytown2 |
Comments
Comment #1
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedTried to install Boost later on in the installation process by adding
module_enable(array('boost'), FALSE);
to my profile_install(). Got these errors:Comment #2
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedTried
module_enable(array('boost'), FALSE);
even later on in the install process, in the last user-defined installation task (just before install_finished), but the same error occurred.Notice : Undefined index: include_file in _boost_get_menu_router() (line 628 of /home/user/Public/Sites/examplesite/sites/all/modules/boost/boost.module).
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedLooks like this fix introduced some other side affects
http://drupal.org/node/325813#comment-4122116
don't undo it; just means I need a different way of doing this.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedcommitted this
Comment #5
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedThanks for the patch. I still get the same error by having Boost as dependency in my installation profile, but now I get a different error when I enable the module in exampleprofile_install():
Warning: rmdir(cache/normal/example.com/): Directory not empty in _boost_rmdir() (line 1041 of /home/user/Public/Sites/examplesite/sites/all/modules/boost/boost.module).
The directory cache/normal is created, writable by the web server and empty, before the installation. After the error stops the installation, the directory example.com has been created in cache/normal, and contains .htaccess.
Comment #6
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedTried it again in the step before the install_finished, and got the same errors as the post above, except twice.
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedcommitted this patch. see if this helps
Comment #8
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedThat did the trick. I was able to install the site with the installation profile, having Boost as a dependency. Thanks for the efficient solution!
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedComment #10
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedI have no idea why, but another installation profile is failing with Boost as dependency. It's on the same multi-site installation, so I can't understand why the other one is failing. The first one works great, as mentioned in #8. cache/normal is empty, before I try to install.
Comment #11
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedIt worked by adding it via module_enable() in profile_install(), so that's what I will do with this installation profile.
Comment #12
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedNow it fails when I try to install from the first installation profile as well, when I have Boost as dependency. I will just go ahead and add the module through profile_install().
Comment #13
mikeytown2 CreditAttribution: mikeytown2 commentedWhat does it fail on; how does it fail? I can't fix what I don't know :)
Comment #14
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedStill the same as in the original post :)
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://example.com/install.php?profile=example&locale=fr&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 0, 1; Array ( ) in menu_get_item() (line 443 of /home/user/Public/Sites/examplesite/includes/menu.inc).
Comment #15
mikeytown2 CreditAttribution: mikeytown2 commentedCommitted this patch... let me know :)
Comment #16
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedStill no go, I'm afraid. Same error as before.
Comment #17
nunof CreditAttribution: nunof commentedAlso having the same problem... Subscribing.
Comment #18
nunof CreditAttribution: nunof commentedI think I know what the problem is...
The menu module should be a dependency of boost.
Comment #19
quartsize CreditAttribution: quartsize commentedI suspect making menu module a dependency of Boost only prevents the error by running menu_rebuild() when it is enabled, and thus before Boost calls menu_get_item().
I believe this issue is a manifestation of #1026474: Menu system does not always get rebuilt when needed: Boost calls menu_get_item() before system variable menu_masks is set. So menu_get_ancestors() returns an empty array, and menu_get_item() generates an invalid SQL query, since it does not expect menu_get_ancestors() to return an empty array.
Comment #20
JLambrecht CreditAttribution: JLambrecht commentedUpgrade of mysql, php, apache2 fixed this for me. Also upgrade to innodb, which is probaly the actual fix.