Posts Tagged with yii error

Displaying 1-10 of 11 results.
Resolved: Yii 1.1 Change assets folder path directory from assets to another
posted by admin on October 31, 2016
By default we have assets folder, and in server I cant create folder in assets, or copy assets folders with files, I got an internal server error, and website generate js and css errors. How I can change assets folders to another directory.Read more
Resolved: Yii 1.1 Cmenu item url array working by wrong logic
posted by admin on October 11, 2016
Cmenu item url working not correct.
It take my current url and the compose new url, and it is wrong.
For example it looks like like this

http://bukivedi.store/index.php?r=stores/stores/user

But I have only module Stores and want to view result:

http://bukivedi.store/index.php?r=stores/user

My Cmenu array is here:

array('label'=>'Таблицы <span class="caret"></span>', 'url'=>array('#'),
'itemOptions'=>array('class'=>'dropdown'),
'linkOptions'=> array(
'class' => 'dropdown-toggle',
'data-toggle' => 'dropdown',
),
'items' => array(
array('label' => 'Пользователи', 'url' => array('stores/user')),
array('label' => '', 'url' => array('#'), 'itemOptions'=>array('role'=>'separator', 'class'=>'divider')),
),
),
Read more
Resolved: Yii 1.1 yii alias module is invalid
posted by admin on October 10, 2016
I had module
store
After renaming it to stores.
in controller StoreModule to StoresModule and in main.php min modules array store to stores
I have got this error

Alias "stores.StoresModule" is invalid. Make sure it points to an existing PHP file and the file is readable.
Read more
Resolved: Yii 1: Uncaught TypeError: jQuery(...).yiiactiveform is not a function
posted by admin on October 10, 2016
In form pages I have got an error like this

Yii 1: Uncaught TypeError: jQuery(...).yiiactiveform is not a function

Form:

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
...
<?php $this->endWidget(); ?>

head:

...
<?php Yii::app()->clientScript->registerScriptFile(app::baseUrl(false, "/js/", "jquery-1.9.1.min.js"), CClientScript::POS_HEAD);?>
...

Warning:
app::baseUrl(false, "/js/", "jquery-1.9.1.min.js") - it is my function and class, repace it by Yii baseURL propertyRead more
Resolved: Yii CGridView pagination not working and alert 500 or 404 error
posted by admin on April 23, 2016
I have trouble about cgridview pagination.
I am using admin page(/{module}/admin that) generated by gii.
it has search form and grid with pagination. its work well without urlmanager

but my team have create urlmanager rule long ago.

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',

),
),


when I use admin page with this urlmanager rule. It has some problem.
- if not using grid sort or pagination. I can filter in grid and form.
- but if using sort or pagination. I can not filtering in grid and form anymore.

page link is wierd and i think because of some attribute(params) are null like this

/{module}/{controller}/admin/BookManageMain%5Bbmm_code%5D//BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid

if I am copy this url to another tab and Its can not filtering in grid and form too.
but if I remove attribute that has null value(BookManageMain%5Bbmm_code%5D//) I can filter grid and form.

/{module}/{controller}/admin/BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid

console log (not sure filter use POST and sort/page use GET)

before click pagerlink or sorting
.../{controller}/action?BookManageMain%5Bbmm_code%5D=&BookManageMain%5Bbmm_tid%5D=2&...&BookManageMain_page=1&ajax=book-manage-main-grid

after click

.../{controller}/action/BookManageMain%5Bbmm_code%5D//BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid
Read more
Resolved: Yii file save error Directory must be writable
posted by admin on April 11, 2016
I have form, and I create directory by mkdir

mkdir($mydirectory, 0777, true);


And got an error during save my file, which I try to upload from my _form.php

Directory must be writable
Read more
Resolved: Yii 1.1 Errors not working, throw only yii exeption
posted by admin on April 7, 2016
I got this Yii error on my CRUD UPDATE by $id

The requested page does not exist.


Error line

public function loadModel($id)
{
$model=Media::model()->findByPk((int)$id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');//error line
return $model;
}
Read more
Resolved: Yii Captcha Broken Image
posted by admin on March 12, 2016
The captcha image is broken (no image appearing). The other components of captcha (links, error matching code etc) seem to work correctly

In Controller:

public function actions() {
return array(
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor' => 0xFFFFFF,
),
);
}


In View:

<?php if (CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model, 'verifyCode'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<?php echo $form->textField($model, 'verifyCode'); ?>
</div>
<div class="hint">Please enter the letters as they are shown in the image above.

Letters are not case-sensitive.</div>
<?php echo $form->error($model, 'verifyCode'); ?>
</div>
<?php endif; ?>


In Model:

public $verifyCode;
....
public function rules() {
return array(
....
....
array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),
);
}


Why I have this problem?Read more
Resolved: Yii DbConnection failed to open the DB connection: invalid data source name
posted by admin on January 22, 2016
DbConnection failed to open the DB connection: invalid data source name error, after uploading project to live. In local host all is right.

// This is the database connection configuration.
return array(
//'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
// uncomment the following lines to use a MySQL database

'connectionString' => 'abcdefg.mysql.com;dbname=janna',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
);
Read more
Resolved: Yii admin module link url default
posted by admin on January 21, 2016
I create admin module, and try to open link http://localhost/test/admin , and get 404 error, object not found.Read more