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

CommentFileSizeAuthor
#1 1320634.patch447 bytesnick_vh

Comments

nick_vh’s picture

StatusFileSize
new447 bytes

I created a patch for an easier review process. Seems like this patch could solve a lot of troubles.

pcambra’s picture

Status: Active » Reviewed & tested by the community

Works for my install profile!
Thanks

dgiamporcaro’s picture

Tested and it works for me
Thanks

nick_vh’s picture

Status: Reviewed & tested by the community » Fixed

And committed! Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.