I'm receiving this error on install of site with apachesolr_search in one of my features:
WD menu: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null: INSERT INTO {menu_router} ...
The reason is following code in function apachesolr_search_page_load:
if ($page) {
$page->settings = unserialize($page->settings);
// Special case page - always uses the default environment.
if ($page->page_id == 'core_search') {
$page->env_id = apachesolr_default_environment();
}
}
$pages[$page_id] = $page;
The problem is that the search page is saved in the static variable even if the page was not found in DB yet.
Code should be...
if ($page) {
$page->settings = unserialize($page->settings);
// Special case page - always uses the default environment.
if ($page->page_id == 'core_search') {
$page->env_id = apachesolr_default_environment();
}
$pages[$page_id] = $page;
}
This is still the case in 7.x1.0-beta10 and 7.x-1.x-dev
Comments
Comment #1
nick_vhI created a patch for an easier review process. Seems like this patch could solve a lot of troubles.
Comment #2
pcambraWorks for my install profile!
Thanks
Comment #3
dgiamporcaro commentedTested and it works for me
Thanks
Comment #4
nick_vhAnd committed! Thanks all!