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

Fix a few initial bugs with the merge

parent d629de20
Branches
Tags
No related merge requests found
...@@ -102,7 +102,8 @@ class Cron { ...@@ -102,7 +102,8 @@ class Cron {
self::PurgeDrafts(); self::PurgeDrafts();
self::MaybeOptimizeTables(); self::MaybeOptimizeTables();
Signal::send('cron', null); $data = array('autocron'=>false);
Signal::send('cron', $data);
} }
} }
?> ?>
...@@ -65,6 +65,7 @@ class Internationalization { ...@@ -65,6 +65,7 @@ class Internationalization {
// Note that group requires department // Note that group requires department
'group.yaml' => 'Group::create', 'group.yaml' => 'Group::create',
'file.yaml' => 'AttachmentFile::create', 'file.yaml' => 'AttachmentFile::create',
'sequence.yaml' => 'Sequence::__create',
); );
$errors = array(); $errors = array();
......
...@@ -33,7 +33,7 @@ abstract class SearchBackend { ...@@ -33,7 +33,7 @@ abstract class SearchBackend {
abstract function update($model, $id, $content, $new=false, $attrs=array()); abstract function update($model, $id, $content, $new=false, $attrs=array());
abstract function find($query, $criteria, $model=false, $sort=array()); abstract function find($query, $criteria, $model=false, $sort=array());
function register($backend=false) { static function register($backend=false) {
$backend = $backend ?: get_called_class(); $backend = $backend ?: get_called_class();
if ($backend::$id == false) if ($backend::$id == false)
...@@ -362,7 +362,17 @@ class MysqlSearchBackend extends SearchBackend { ...@@ -362,7 +362,17 @@ class MysqlSearchBackend extends SearchBackend {
. ' LIMIT 500'; . ' LIMIT 500';
} }
$res = db_query($sql); $class = get_class();
$auto_create = function($db_error) use ($class) {
if ($db_error != 1146)
// Perform the standard error handling
return true;
// Create the search table automatically
$class::createSearchTable();
};
$res = db_query($sql, $auto_create);
$object_ids = array(); $object_ids = array();
while ($row = db_fetch_row($res)) while ($row = db_fetch_row($res))
......
...@@ -192,6 +192,12 @@ class Sequence extends VerySimpleModel { ...@@ -192,6 +192,12 @@ class Sequence extends VerySimpleModel {
return $this->current(); return $this->current();
return parent::__get($what); return parent::__get($what);
} }
function __create($data) {
$instance = parent::create($data);
$instance->save();
return $instance;
}
} }
class RandomSequence extends Sequence { class RandomSequence extends Sequence {
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
} ?> } ?>
</div><div> </div><div>
<?php <?php
$f->render();
if ($internal && !$f->isEditable()) if ($internal && !$f->isEditable())
$f->render('view'); $f->render('view');
else { else {
......
...@@ -49,6 +49,9 @@ if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enab ...@@ -49,6 +49,9 @@ if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enab
$ost->logDebug(_S('Auto Cron'), sprintf(_S('Mail fetcher cron call [%s]'), $caller)); $ost->logDebug(_S('Auto Cron'), sprintf(_S('Mail fetcher cron call [%s]'), $caller));
} }
$data = array('autocron'=>true);
Signal::send('cron', $data);
$_SESSION['lastcroncall']=time(); $_SESSION['lastcroncall']=time();
endif; endif;
ob_end_clean(); ob_end_clean();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment