Index: branches/5.1.x/core/kernel/db/dbitem.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 12127)
+++ branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 12657)
@@ -1,6 +1,6 @@
Fields[$field]['error_field']) ? $this->Fields[$field]['error_field'] : $field;
if (isset($this->FieldErrors[$error_field]['pseudo'])) {
// don't set more then one error on field
- return ;
+ return false;
}
$this->FieldErrors[$error_field]['pseudo'] = $pseudo;
@@ -219,6 +223,8 @@
// label for error (only when not already set)
$this->ErrorMsgs[$pseudo] = (substr($error_label, 0, 1) == '+') ? substr($error_label, 1) : '!'.$error_label.'!';
}
+
+ return true;
}
/**
@@ -231,6 +237,10 @@
*/
function GetDBField($name)
{
+ /*if (!array_key_exists($name, $this->FieldValues) && defined('DEBUG_MODE') && DEBUG_MODE) {
+ $this->Application->Debugger->appendTrace();
+ }*/
+
return $this->FieldValues[$name];
}
@@ -1071,7 +1081,7 @@
function setModifiedFlag($mode = null)
{
$main_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
- $this->Application->StoreVar($main_prefix.'_modified', '1');
+ $this->Application->StoreVar($main_prefix.'_modified', '1', !$this->Application->IsAdmin());
if ($this->ShouldLogChanges()) {
$this->LogChanges($main_prefix, $mode);
@@ -1223,21 +1233,23 @@
function Clear($new_id = null)
{
- $this->setID($new_id);
$this->Loaded = false;
$this->FieldValues = Array();
$this->OriginalFieldValues = Array ();
- $this->SetDefaultValues();
+ $this->SetDefaultValues(); // will wear off kDBItem::setID effect, so set it later
$this->FieldErrors = Array();
+
+ $this->setID($new_id);
+
return $this->Loaded;
}
function Query($force = false)
{
- if( $this->Application->isDebugMode() )
- {
+ if ($this->Application->isDebugMode()) {
$this->Application->Debugger->appendTrace();
}
+
trigger_error('Query method is called in class '.get_class($this).' for prefix '.$this->getPrefixSpecial().'', E_USER_ERROR);
}
@@ -1284,8 +1296,5 @@
{
return Array (0 => $this->GetDBField($field));
}
-}
-
-
-?>
\ No newline at end of file
+}
\ No newline at end of file