Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-32014

Moodle 2.2.2 violates not-null constraint on table mdl_user.descriptionformat when inserting a newuser

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
      None
    • Environment:
      SLES 11 SP2
      PHP 5.3.8
      Postgres 8.3.14
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      Install moodle and try to add admin user.

      Show
      Install moodle and try to add admin user.
    • Workaround:
      Hide

      Disable not-null constraint on mdl_user.descriptionformat database column

      Show
      Disable not-null constraint on mdl_user.descriptionformat database column
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      I did a fresh install so when I add "admin" user i get this error message:

      Error writing to database

      I checked the database log and findout this error:

      ERROR: null value in column "descriptionformat" violates not-null constraint
      STATEMENT: INSERT INTO mdluab_user (username,auth,suspended,firstname,lastname,email,maildisplay,mailformat,maildigest,autosubscribe,trackforums,htmleditor,ajax,screenreader,city,country,timezone,lang,imagealt,url,icq,skype,aim,yahoo,msn,idnumber,institution,department,phone1,phone2,address,timemodified,description,descriptionformat,mnethostid,confirmed,timecreated,password) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38) RETURNING id

      The tables are already created when "admin" user add page appears on installing. I disabled the not-null constraint on column descriptionformat in table mdl_user so I have sucess adding admin user. I checked which value was saved in database and that column, descriptionformat, has no value, it is empty. The same error occours when I try to insert a new user/account.

        Gliffy Diagrams

          Activity

          Hide
          skodak Petr Skoda added a comment -

          Hello,

          I can not reproduce this problem, the descriptionformat comes directly from the form.

          Please reinstall all your PHP files and try fresh new installation with a different database prefix, please do not change anything and use some common browser.

          Petr

          Show
          skodak Petr Skoda added a comment - Hello, I can not reproduce this problem, the descriptionformat comes directly from the form. Please reinstall all your PHP files and try fresh new installation with a different database prefix, please do not change anything and use some common browser. Petr
          Hide
          titofr Sergio Tito added a comment -

          This problem is related to PHP installed from SLES DVD. There is a path for PHP in SLES official repository that solves this problem.

          Show
          titofr Sergio Tito added a comment - This problem is related to PHP installed from SLES DVD. There is a path for PHP in SLES official repository that solves this problem.
          Show
          matteo Matteo Scaramuccia added a comment - Hi Sergio, is it something related with this PHP update, http://lists.opensuse.org/opensuse-security-announce/2012-04/msg00001.html (more in http://moodle.org/mod/forum/discuss.php?d=199754#p876476)?
          Hide
          titofr Sergio Tito added a comment - - edited

          Hi Matteo
          The patch I tested and solved my problem is:

          Important: Security update for PHP5 (5958)
          Patch: slessp2-apache2-mod_php53-5958
          CVEs: CVE-2011-4153, CVE-2012-0057, CVE-2012-0807, CVE-2012-0831
          Bugs: 741520, 741859, 743308, 746661, 749111

          I think the first link you posted is the same patch. I didn´t change any configuration on php, apache or moodle setup. I just applied the SUSE patch and I could finish moodle instalation.

          Show
          titofr Sergio Tito added a comment - - edited Hi Matteo The patch I tested and solved my problem is: Important: Security update for PHP5 (5958) Patch: slessp2-apache2-mod_php53-5958 CVEs: CVE-2011-4153, CVE-2012-0057, CVE-2012-0807, CVE-2012-0831 Bugs: 741520, 741859, 743308, 746661, 749111 I think the first link you posted is the same patch. I didn´t change any configuration on php, apache or moodle setup. I just applied the SUSE patch and I could finish moodle instalation.
          Hide
          matteo Matteo Scaramuccia added a comment -

          TNX!
          It will be useful for the record.

          Show
          matteo Matteo Scaramuccia added a comment - TNX! It will be useful for the record.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: