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

SQL Error when adding a resource

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.9.3
    • Component/s: Resource
    • Labels:
      None
    • Environment:
      Apache 2.0.59
      Windows Server 2003
      PHP 5.2.5
      MySQL 5.0.51b-Community-NT
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Using Moodle 1.9.2+ (Build: 20080730)
      The error "could not add a new instance of resource" is displayed when trying to add a new resource using the steps below:

      1. Add A Resource (Link to a file or website)
      2. Give it a name
      3. Give it a description
      4. Choose the file
      5. Window = Same Window
      6. Check "Force Download"
      7. Click "Save and Display"

      The following information is displayed when debugging is set to developer:

      Field 'popup' doesn't have a default value

      INSERT INTO mdl_resource ( COURSE, NAME, TYPE, REFERENCE, SUMMARY, ALLTEXT, OPTIONS, TIMEMODIFIED ) VALUES ( 3, 'Lab: Determining PAT Translations ', 'file', 'Labs/Lab_4-2-4_Determining_PAT_Translations.pdf', 'Lab: Determining PAT Translations ', '', 'forcedownload', 1217707295 )

      • line 1554 of lib\dmllib.php: call to debugging()
      • line 215 of mod\resource\lib.php: call to insert_record()
      • line 125 of mod\resource\type\file\resource.class.php: call to resource_base->add_instance()
      • line 266 of mod\resource\lib.php: call to resource_file->add_instance()
      • line 284 of course\modedit.php: call to resource_add_instance()

      Could not add a new instance of resource

      Stack trace:

      • line 1651 of lib\deprecatedlib.php: call to debugging()
      • line 286 of course\modedit.php: call to error()

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Oct/08