Skip to content
Snippets Groups Projects
Commit 350bd6d2 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix crashes on installation

parent e63f91f1
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@ class ModelMeta implements ArrayAccess {
'defer' => array(),
'select_related' => array(),
'view' => false,
'joins' => array(),
'foreign_keys' => array(),
);
static $model_cache;
......@@ -68,7 +70,7 @@ class ModelMeta implements ArrayAccess {
sprintf(__('%s: Model does not define meta.pk'), $model));
// Ensure other supported fields are set and are arrays
foreach (array('pk', 'ordering', 'defer') as $f) {
foreach (array('pk', 'ordering', 'defer', 'select_related') as $f) {
if (!isset($meta[$f]))
$meta[$f] = array();
elseif (!is_array($meta[$f]))
......@@ -76,8 +78,6 @@ class ModelMeta implements ArrayAccess {
}
// Break down foreign-key metadata
if (!isset($meta['joins']))
$meta['joins'] = array();
foreach ($meta['joins'] as $field => &$j) {
$this->processJoin($j);
if ($j['local'])
......@@ -327,7 +327,7 @@ class VerySimpleModel {
else
throw new InvalidArgumentException(
sprintf(__('Expecting NULL or instance of %s. Got a %s instead'),
$j['fkey'][0], get_class($value)));
$j['fkey'][0], is_object($value) ? get_class($value) : gettype($value)));
// Capture the foreign key id value
$field = $j['local'];
......@@ -2058,6 +2058,7 @@ class MySqlCompiler extends SqlCompiler {
function compileCount($queryset) {
$model = $queryset->model;
$model::_inspect();
$table = $model::$meta['table'];
list($where, $having) = $this->getWhereHavingClause($queryset);
$joins = $this->getJoins($queryset);
......
......@@ -73,7 +73,7 @@ class TicketModel extends VerySimpleModel {
'null' => true,
),
'thread' => array(
'reverse' => 'Thread.ticket',
'reverse' => 'TicketThread.ticket',
'list' => false,
'null' => true,
),
......@@ -220,6 +220,7 @@ implements RestrictedAccess, Threadable {
);
var $lastMsgId;
var $last_message;
var $owner; // TicketOwner
var $_user; // EndUser
......@@ -3075,9 +3076,10 @@ implements RestrictedAccess, Threadable {
$ticket = parent::create(array(
'created' => SqlFunction::NOW(),
'lastupdate' => SqlFunction::NOW(),
'number' => $number,
'user' => $user,
'dept' => $deptId,
'topicId' => $topicId,
'dept_id' => $deptId,
'topic_id' => $topicId,
'ip_address' => $ipaddress,
'source' => $source,
));
......
......@@ -11,7 +11,7 @@ a { color: #2a67ac; display: inline-block; }
.hidden { display: none;}
.error { color:#f00;}
#header { height: 72px; margin-bottom: 20px; width: 100%; }
#header { min-height: 72px; margin-bottom: 20px; width: 100%; }
#header #logo { width: 280px; height: 72px; display: block; float: left; }
#header .info { font-size: 11pt; font-weight: bold; border-bottom: 1px solid #2a67ac; color: #444; text-align: right; float: right; }
#header ul { margin: 0; padding: 0; text-align: right; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment