Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 3.0
-
Fix Version/s: Unscheduled
-
Component/s: Standalone CiviCRM
-
Labels:None
Description
I am upgrading from 2.2.2 to 3.0.0 following the instructions at <http://wiki.civicrm.org/confluence/display/CRMDOC/Upgrade+Standalone+Sites+to+3.0>. There it is stated that in order to call civicrm/upgrade "you should already be logged in to Standalone with administrator-level permissions. If not logged in do now and proceed". At this point howerver, I'm using the old pre-update database with the new codebase. When trying to log in, I get the following error:
<code>
Error Details:
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT *
FROM civicrm_preferences
WHERE ( civicrm_preferences.domain_id = 1 ) AND ( civicrm_preferences.is_domain = 1 )
[nativecode=1054 ** Unknown column 'civicrm_preferences.domain_id' in 'where clause']
[type] => DB_Error
[user_info] => SELECT *
FROM civicrm_preferences
WHERE ( civicrm_preferences.domain_id = 1 ) AND ( civicrm_preferences.is_domain = 1 )
[nativecode=1054 ** Unknown column 'civicrm_preferences.domain_id' in 'where clause']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
FROM civicrm_preferences
WHERE ( civicrm_preferences.domain_id = 1 ) AND ( civicrm_preferences.is_domain = 1 )
[nativecode=1054 ** Unknown column 'civicrm_preferences.domain_id' in 'where clause']"]
)
</code>
I suppose the new code expected a different database structure.
As it turns out, the login itself worked fine, and I can run the upgrade after ignoring the error and entering the upgrade URL. The error only occurs when civicrm tries to show me the default dashboard after login.
Expected behavior: I should be able to log in in order to perform the upgrade.
Proposed fix: check the version of the database schema against the code version, e.g. by writing the version of the db schema into some special field in the database. The check should be performed at least on login, but ideally on every request. If the db structure is outdated, disable all operations except updating. Provide a meaningful error message to that effect, including a link to the upgrade function.