Concrete 5 SQL errors during installation
Friday, February 3rd, 2012We have seen this error with Concrete 5.5.1
You try to setup Concrete 5, and get strange SQL errors during the installation:
If installing with an empty site, like this
you get:
mysql error: [1048: Column 'uID' cannot be null] in EXECUTE("INSERT INTO Config (cfKey,cfValue,uID) VALUES ('NEWSFLOW_LAST_VIEWED','FIRSTRUN',NULL)")
If installing with Sample content with Blog:
The error you get is:
Catchable fatal error: Argument 1 passed to ContentImporter::importPageAreas() must be an instance of Page, boolean given, called in /concrete/libraries/content/importer.php on line 75 and defined in /concrete/libraries/content/importer.php on line 197.
Solution:
You don't run Varnish by any chance, do you? We do, and we had it set up to … dispose of some cookies. The solution is, in Varnish' case, to enable pass-through for the host you are installing on.
You want to enable cookies.
Explanation:
The code which breaks is located in concrete5.5.1\concrete\models\package\starting_point.php
Config::save('SITE', SITE);
Config::save('SITE_APP_VERSION', APP_VERSION);
$u = new User();
$u->saveConfig('NEWSFLOW_LAST_VIEWED', 'FIRSTRUN');
As you see, this is the first time a User is created and used.
The User class is defined in concrete5.5.1\concrete\models\user.php
if (isset($_SESSION['uID'])) {
$this->uID = $_SESSION['uID'];
$this->uName = $_SESSION['uName'];
$this->uTimezone = $_SESSION['uTimezone'];
if (isset($_SESSION['uDefaultLanguage'])) {
$this->uDefaultLanguage = $_SESSION['uDefaultLanguage'];
}
$this->superUser = ($_SESSION['uID'] == USER_SUPER_ID) ? true : false;
} else {
$this->uID = null;
$this->uName = null;
$this->superUser = false;
$this->uDefaultLanguage = null;
$this->uTimezone = null;
}
$this->uGroups = $this->_getUserGroups();
if (!isset($args[2])) {
$_SESSION['uGroups'] = $this->uGroups;
}
}
The constructor checks in the Session for a valid user ID. If no user ID is found, it is set to zero. This happens if you throw away the cookies! Because the session is stored in them.
HTH. Feel free to comment on similar errors and solutions.



