Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Not a bug
-
Affects Version/s: 1.9.3
-
Fix Version/s: None
-
Component/s: Questions
-
Labels:None
-
Environment:Linux, php5, postgres8.3
-
Database:PostgreSQL
-
Affected Branches:MOODLE_19_STABLE
Description
I trying to upgrade moodle from 1.5 to 1.9.3, folling the instructions on upgradingo moodle (1.5->1.6->1.8->1.9), I can upgrade to 1.8.9 without any problem, but whe i try to upgrade to 1.9 , the upgrade process stops with this erro
(postgres7): SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='mdl_question_categories' order by d.adnum (postgres7): UPDATE mdl_question_categories SET name = '',info = '',stamp = 'ebaula.ensino.eb.br+080601172801+RBEFrc',parent = '125',sortorder = '999',contextid = NULL WHERE id = 167 -1: ERROR: null value in column "contextid" violates not-null constraint
ADOConnection._Execute(UPDATE mdl_question_categories SET name = '',info = '',stamp = 'ebaula.ensino.eb.br+080601172801+RBEFrc',parent = '125',sortorde..., false) % line 891, file: adodb.inc.php
ADOConnection.Execute(UPDATE mdl_question_categories SET name = '',info = '',stamp = 'ebaula.ensino.eb.br+080601172801+RBEFrc',parent = '125',sortorde...) % line 1703, file: dmllib.php
update_record(question_categories, Object:stdClass) % line 292, file: upgrade.php
question_upgrade_context_etc() % line 1673, file: upgrade.php
xmldb_main_upgrade(2007080903) % line 364, file: index.php
During the environment, there is a warning about Random Questions Selecting from Subcategories, but when i click in the links i get access denied error (admin/report/question/index.php), or goes to moodle docs page.
Can you try
SELECT * FROM mdl_question_categories WHERE course IS NULL;
or
SELECT * FROM mdl_question_categories qc LEFT JOIN mdl_course c ON qc.course = c.id WHERE c.id IS NULL;
Both of those queries should return nothing. However, if there is a problem in your Moodle database before upgrading, one of them will, and the data it returns may help us diagnose the problem.