Merge pull request #78 from yiicrew/master

installer database issue
This commit is contained in:
luke- 2014-07-24 14:57:26 +02:00
commit 43e4a77531
3 changed files with 25 additions and 10 deletions

View File

@ -1,3 +1,2 @@
<?php return array ( <?php return array (
); ?> ); ?>

View File

@ -240,19 +240,30 @@ class HSetting extends HActiveRecord
} }
/** /**
* Saving the registry object * clears cache
* Also deletes cache Entry * @return void
*
* @param type $runValidation
* @param type $attributes
* @return type
*/ */
public function save($runValidation = true, $attributes = null) public function clearCache()
{ {
Yii::app()->cache->delete($this->getCacheId()); Yii::app()->cache->delete($this->getCacheId());
RuntimeCache::Remove($this->getCacheId()); RuntimeCache::Remove($this->getCacheId());
return parent::save($runValidation, $attributes); }
public function beforeSave()
{
$this->clearCache();
if ($this->hasAttribute('created_by') && empty($this->created_by))
$this->created_by = 0;
if ($this->hasAttribute('updated_by') && empty($this->updated_by))
$this->updated_by = 0;
if ($this->hasAttribute('updated_at') && empty($this->updated_at))
$this->updated_at = new CDbExpression('NOW()');
return parent::beforeSave();
} }
/** /**

View File

@ -190,6 +190,8 @@ class ConfigController extends Controller
$form['User']->model->status = User::STATUS_ENABLED; $form['User']->model->status = User::STATUS_ENABLED;
$form['User']->model->super_admin = true; $form['User']->model->super_admin = true;
$form['User']->model->language = '';
$form['User']->model->last_activity_email = new CDbExpression('NOW()');
$form['User']->model->save(); $form['User']->model->save();
$form['Profile']->model->user_id = $form['User']->model->id; $form['Profile']->model->user_id = $form['User']->model->id;
@ -318,6 +320,7 @@ class ConfigController extends Controller
$cGeneral->sort_order = 100; $cGeneral->sort_order = 100;
$cGeneral->visibility = 1; $cGeneral->visibility = 1;
$cGeneral->is_system = true; $cGeneral->is_system = true;
$cGeneral->description = '';
$cGeneral->save(); $cGeneral->save();
$cCommunication = new ProfileFieldCategory; $cCommunication = new ProfileFieldCategory;
@ -325,6 +328,7 @@ class ConfigController extends Controller
$cCommunication->sort_order = 200; $cCommunication->sort_order = 200;
$cCommunication->visibility = 1; $cCommunication->visibility = 1;
$cCommunication->is_system = true; $cCommunication->is_system = true;
$cCommunication->description = '';
$cCommunication->save(); $cCommunication->save();
$cSocial = new ProfileFieldCategory; $cSocial = new ProfileFieldCategory;
@ -332,6 +336,7 @@ class ConfigController extends Controller
$cSocial->sort_order = 300; $cSocial->sort_order = 300;
$cSocial->visibility = 1; $cSocial->visibility = 1;
$cSocial->is_system = true; $cSocial->is_system = true;
$cSocial->description = '';
$cSocial->save(); $cSocial->save();
// Add Fields // Add Fields