Age | Commit message (Collapse) | Author | Files | Lines |
|
This particular flaw was dampening (and could popentially be hiding) the
effects of other bugs.
For instance, in this case, a GUID of "" was invalidly being used to
construct an object. This should obviously be considered an error, but
since "" evaluates to false, the construction was treated as default (no
GUID) construction and succedded. It wasn't until later when missing
properties were accessed that random PHP error messages clued me into what
was happening.
Now, when any sort of explicit value is used to construct an object (not
NULL), an object load will be attempted, giving bad input more chances
to fail outright and trigger an exception. In addition, the 'no such
guid' exception message is updated to place quotes ('') around the GUID
string to make it more obvious when "" is used in the future.
|
|
These two functions, 'getCurrentTimestamp()' and 'isGUID()' are updated
to be public. There is actually no good reason for them to be private;
I originally just never antisipated their use outside this class.
I need isGUID() in index.php to help with page routing. Neither of
these two functions have side effects of any kind nor any unexpected
behavior, so there is no harm in going public.
|
|
If a table query yeilds zero rows, we would still attempt to load the
first (index zero) into $this, causing an error to be thrown by PHP. We
are now checking the size of the results array first.
|
|
Added call to refreshObj() to the end of function saveObj() to fetch all
default values defined by the database, not set on the object in PHP.
|
|
This reverts commit e7228676ce51bf69cc974fc0bd8f8135c51fd036.
|
|
While creating new objects, some default values (defined in the database
schema) are missing in the PHP object definition. To address this, now
while saving any *new* database objects, all undefined, expected fields
are set to the empty string "".
|
|
|
|
protected function exceptType added for use by subclasses to assert that
the database object loaded is the correct type and to protect against
cases like EG: passing the GUID for a group to new user(...); If a
problem is detected, throw an exception.
|
|
Various function (and their usages) in the table class have been updated
to be static class function.
|
|
|
|
Just use a generic exception in these cases. I don't want to handle
these any differently, and just fall back on the main Exception() error
page once we get to a UI.
|
|
|
|
|