]> git.mjollnir.org Git - moodle.git/commitdiff
Argh! More than 3 hours searching for this error! I was calling one
authorstronk7 <stronk7>
Thu, 28 Sep 2006 20:06:08 +0000 (20:06 +0000)
committerstronk7 <stronk7>
Thu, 28 Sep 2006 20:06:08 +0000 (20:06 +0000)
constructor with wrong number of parameters and PHP said nothing at
all (with DEVELOPER level of debugging). Horrible OOP !

lib/ddllib.php

index 462ed952042663a7ef6fd0621f45bc8ad06a5e28..cf4b32e4710dab7acf59eede95c2f29ddbe3445b 100644 (file)
@@ -610,7 +610,8 @@ function add_key($table, $key, $continue=true, $feedback=true) {
 
 /// Check there isn't any index with the same fields
 /// if it exists we don't create the key
-    $index = new XMLDBIndex('anyname', XMLDB_INDEX_UNIQUE, $key->getFields());
+    $index = new XMLDBIndex('anyname');
+    $index->setAttributes(XMLDB_INDEX_UNIQUE, $key->getFields());
     if ($indexexists = find_index_name($table, $index)) {
     /// TODO print some notify here (id debuglevel is DEVELOPER)
         return true; //Index exists, nothing to do
@@ -628,7 +629,7 @@ function add_key($table, $key, $continue=true, $feedback=true) {
  *
  * @uses $CFG, $db
  * @param XMLDBTable table object (just the name is mandatory)
- * @param XMLDBIndex key object (full specs are required)
+ * @param XMLDBKey key object (full specs are required)
  * @param boolean continue to specify if must continue on error (true) or stop (false)
  * @param boolean feedback to specify to show status info (true) or not (false)
  * @return boolean true on success, false on error
@@ -652,7 +653,8 @@ function drop_key($table, $key, $continue=true, $feedback=true) {
 
 /// Check there is one index with the same fields
 /// if it exists we'll drop the key
-    $index = new XMLDBIndex('anyname', XMLDB_INDEX_UNIQUE, $key->getFields());
+    $index = new XMLDBIndex('anyname');
+    $index->setAttributes(XMLDB_INDEX_UNIQUE, $key->getFields());
     if (!$indexexists = find_index_name($table, $index)) {
     /// TODO print some notify here (id debuglevel is DEVELOPER)
         return true; //Index exists, nothing to do