summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-04-13 23:27:41 -0400
committerMalf Furious <m@lfurio.us>2017-04-13 23:27:41 -0400
commita4db163ae8633c3740be2c2582364cb3f5acb9db (patch)
tree5b3ba05e5687100fc9a953f5e4c72ad75ff06b95 /app
parent3b47c5f3876b8c46d199c615e95fe671293be7b7 (diff)
parente7228676ce51bf69cc974fc0bd8f8135c51fd036 (diff)
downloadscrott-a4db163ae8633c3740be2c2582364cb3f5acb9db.tar.gz
scrott-a4db163ae8633c3740be2c2582364cb3f5acb9db.zip
Merge branch 'bug/refreshObj' into dev
Diffstat (limited to 'app')
-rw-r--r--app/class/stage.class.php4
-rw-r--r--app/class/table.class.php12
2 files changed, 15 insertions, 1 deletions
diff --git a/app/class/stage.class.php b/app/class/stage.class.php
index 760a9a2..74c5f42 100644
--- a/app/class/stage.class.php
+++ b/app/class/stage.class.php
@@ -152,7 +152,9 @@ class stage extends object
if (!($prev = $this->getPrev()))
return false;
- return $prev->moveForward();
+ $ret = $prev->moveForward();
+ $this->refreshObj();
+ return $ret;
}
/*
diff --git a/app/class/table.class.php b/app/class/table.class.php
index 45be8c5..c547e43 100644
--- a/app/class/table.class.php
+++ b/app/class/table.class.php
@@ -68,6 +68,15 @@ abstract class table
}
/*
+ * This function uses loadObj to re-initialize this object, if in
+ * the case it gets modified in another scope.
+ */
+ public function refreshObj() : void
+ {
+ $this->loadObj($this->guid);
+ }
+
+ /*
* This function will update this object in the database, or insert new
* data if this object does not yet have a GUID. This function uses the
* $fields array to construct SQL queries.
@@ -118,7 +127,10 @@ abstract class table
foreach ($flds as $fld)
{
if (!isset($this->$fld))
+ {
+ $this->$fld = "";
continue;
+ }
$fld = database::esc($fld);
$fldstr .= $fld . ", ";