|
From: <ken...@us...> - 2009-01-26 14:13:53
|
Revision: 1155
http://andro.svn.sourceforge.net/andro/?rev=1155&view=rev
Author: kendowns
Date: 2009-01-26 14:13:47 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
Catch and report errors if yaml file references non-existent properties.
Modified Paths:
--------------
trunk/andro/application/androBuild.php
Modified: trunk/andro/application/androBuild.php
===================================================================
--- trunk/andro/application/androBuild.php 2009-01-26 14:12:45 UTC (rev 1154)
+++ trunk/andro/application/androBuild.php 2009-01-26 14:13:47 UTC (rev 1155)
@@ -863,6 +863,7 @@
$ta["data"]
,$sfx
);
+
$this->LogEntry("Setting aside content for loading after build");
$this->content = array_merge($this->content,$ta['content']);
@@ -899,7 +900,7 @@
$this->DBB_LoadAddFile($spec,$ta);
}
else {
- $retval = $this->DBB_LoadYAMLFile($spec,$ta);
+ $retval = $retval && $this->DBB_LoadYAMLFile($spec,$ta);
}
if($retval) {
$this->LogEntry("Loading spec to main series");
@@ -928,22 +929,6 @@
else {
$this->content[$table_id] = $values;
}
-
- // KFD 3/1/08, major fix to content loading on YAML
- # KFD 6/30/08, try remming this out
- #$colnames = $values[1];
- #$colnames['__type']='columns';
- #$this->content[$table_id][] = $colnames;
-
- #unset($values[2]['__type']);
- #foreach($values[2] as $colvalues) {
- # $this->content[$table_id][]=array_merge(
- # array('__type'=>'values')
- # ,$colvalues
- # );
- # $this->content[$table_id][]=$colvalues;
- #}
- // KFD 3/1/8 END CHANGES
}
}
}
@@ -1117,8 +1102,8 @@
// Finally, execute it
$row['srcfile']=$srcfile;
- $retval = $retval &&
- $this->DBB_Insert("zdd.",$table,$cLoadSuffix,$row);
+ $return = $this->DBB_Insert("zdd.",$table,$cLoadSuffix,$row);
+ $retval = $retval && $return;
}
}
return $retval;
@@ -8716,6 +8701,31 @@
function DBB_Insert($prefix,$table,$suffix,$colvals,$noblanks=false) {
$cols = '';
$vals = '';
+
+ # KFD 1/26/09, SF BUG 1948051, trap bad properties
+ $insert_error = false;
+ foreach($colvals as $name=>$value) {
+ if(!isset($this->utabs[$table]['flat'][$name])) {
+ # Don't stop on our hardcoded meta values
+ if($name=='__keystub') continue;
+ if($name=='uicolseq') continue;
+ if($name=='srcfile') continue;
+ if($name=='auto') continue;
+ if($name=='columns' && $value=='values') continue;
+ if($table=='colchainargs') continue;
+ if($table=='colchaintests') continue;
+ if($table=='colchains') continue;
+
+
+ x_EchoFlush("");
+ x_EchoFlush(" >>> ERROR: BAD PROPERTY NAME");
+ x_EchoFlush(" >>> Cannot set '$name' on '$table' to value '$value'");
+ x_EchoFlush("");
+ hprint_r($colvals);
+ $insert_error = true;
+ }
+ }
+ if($insert_error) return false;
foreach ($this->utabs[$table]["flat"] as $colname=>$colinfo) {
if (isset($colvals[$colname])) { $val = $colvals[$colname]; }
@@ -8752,7 +8762,11 @@
}
$sql = "INSERT INTO ".$prefix.$table.$suffix." ( ".$cols." ) VALUES ( ".$vals." )";
- return $this->SQL($sql);
+ $retval = $this->SQL($sql);
+ if(!$retval) {
+ hprint_r($colvals);
+ }
+ return $retval;
}
function DBB_SQLBlank($formshort) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|