Closed GoogleCodeExporter closed 9 years ago
It seems like isset function is not functioning properly, because
Yum::module()->usersTable working good without checking at YumUser.php.
Original comment by sergey.m...@gmail.com
on 26 Jan 2011 at 10:06
CComponent.php:187 if(method_exists($this,$getter)) -- Check error goes here
I can't understand what's going wrong here?
Original comment by sergey.m...@gmail.com
on 26 Jan 2011 at 10:36
I've figured out what's wrong:
i just added __ISSET() method to UserModule.php
The code is:
public function __isset($name) {
if(substr($name, -5) === 'Table')
return isset($this->_tables[substr($name, 0, -5)]) ? TRUE : FALSE;
if(substr($name, -4) === 'View')
return isset($this->_views[substr($name, 0, -4)]) ? TRUE : FALSE;
if(substr($name, -3) === 'Url')
return isset($this->_urls[substr($name, 0, -3)]) ? TRUE : FALSE;
return parent::__isset($name);
Original comment by sergey.m...@gmail.com
on 27 Jan 2011 at 9:39
This is more correct version:
public function __isset($name) {
if(substr($name, -5) === 'Table')
return isset($this->_tables[substr($name, 0, -5)]);
if(substr($name, -4) === 'View')
return isset($this->_views[substr($name, 0, -4)]);
if(substr($name, -3) === 'Url')
return isset($this->_urls[substr($name, 0, -3)]);
return parent::__isset($name);
}
Original comment by sergey.m...@gmail.com
on 27 Jan 2011 at 9:40
This does also happen to YumActivity for me...
CDbException
Beschreibung
Die Tabelle "{{activities}}" für die ActiveRecord-Klasse "YumActivity" kann
nicht in der Datenbank gefunden werden.
Quelldatei
/Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(2159)
02147: private $_model;
02148:
02149: /**
02150: * Constructor.
02151: * @param CActiveRecord the model instance
02152: */
02153: public function __construct($model)
02154: {
02155: $this->_model=$model;
02156:
02157: $tableName=$model->tableName();
02158:
if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
02159: throw new CDbException(Yii::t('yii','The table "{table}" for
active record class "{class}" cannot be found in the database.',
02160:
array('{class}'=>get_class($model),'{table}'=>$tableName)));
02161: if($table->primaryKey===null)
02162: $table->primaryKey=$model->primaryKey();
02163: $this->tableSchema=$table;
02164: $this->columns=$table->columns;
02165:
02166: foreach($table->columns as $name=>$column)
02167: {
02168: if(!$column->isPrimaryKey && $column->defaultValue!==null)
02169: $this->attributeDefaults[$name]=$column->defaultValue;
02170: }
02171:
Verfolgung des Aufrufstapels
#0 /Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(353):
CActiveRecordMetaData->__construct(Object(YumActivity))
#1 /Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(367):
CActiveRecord::model('YumActivity')
#2
/Users/sbauer/Projekte/artaius/protected/modules/user/models/YumActiveRecord.php
(24): CActiveRecord->getMetaData()
#3 /Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(62):
YumActiveRecord->getMetaData()
#4
/Users/sbauer/Projekte/artaius/protected/modules/user/controllers/YumActivityCon
troller.php(70): CActiveRecord->__construct()
#5
/Users/sbauer/Projekte/artaius/protected/modules/user/models/YumUser.php(145):
YumActivityController::logActivity(Object(YumUser), 'user_updated')
#6 /Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(1049):
YumUser->afterSave()
#7 /Users/sbauer/Projekte/yii/db/ar/CActiveRecord.php(759):
CActiveRecord->update(NULL)
#8
/Users/sbauer/Projekte/artaius/protected/modules/user/models/YumUser.php(56):
CActiveRecord->save()
#9
/Users/sbauer/Projekte/artaius/protected/modules/user/controllers/YumController.
php(24): YumUser->setLastAction()
#10 /Users/sbauer/Projekte/yii/web/CController.php(298):
YumController->beforeAction(Object(CInlineAction))
#11 /Users/sbauer/Projekte/yii/web/filters/CFilterChain.php(133):
CController->runAction(Object(CInlineAction))
#12 /Users/sbauer/Projekte/yii/web/filters/CFilter.php(41): CFilterChain->run()
#13 /Users/sbauer/Projekte/yii/web/CController.php(1049):
CFilter->filter(Object(CFilterChain))
#14 /Users/sbauer/Projekte/yii/web/filters/CInlineFilter.php(59):
CController->filterAccessControl(Object(CFilterChain))
#15 /Users/sbauer/Projekte/yii/web/filters/CFilterChain.php(130):
CInlineFilter->filter(Object(CFilterChain))
#16 /Users/sbauer/Projekte/yii/web/CController.php(283): CFilterChain->run()
#17 /Users/sbauer/Projekte/yii/web/CController.php(257):
CController->runActionWithFilters(Object(CInlineAction), Array)
#18 /Users/sbauer/Projekte/yii/web/CWebApplication.php(324):
CController->run('')
#19 /Users/sbauer/Projekte/yii/web/CWebApplication.php(121):
CWebApplication->runController('user/auth')
#20 /Users/sbauer/Projekte/yii/base/CApplication.php(135):
CWebApplication->processRequest()
#21 /Users/sbauer/Projekte/artaius/index.php(21): CApplication->run()
#22 {main}
27.01.2011 12:20:15 Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l
PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 Yii Framework/1.1.4
Original comment by gjlnetw...@gmail.com
on 27 Jan 2011 at 11:21
Just adding: of course this happens with YumActivity *after* adding your code
to UserModule.php. So your fix solves at least the problem with the user table.
Original comment by gjlnetw...@gmail.com
on 27 Jan 2011 at 11:25
Ok, got it..
For activites, it's doing a lookup for the key "activities", but the key in the
_tables array is actually called "activity."
So, changing this:
'activitiy' => 'activities',
to this:
'activities' => 'activities',
Solves the latter issue.
Original comment by gjlnetw...@gmail.com
on 27 Jan 2011 at 11:37
Use fixed file instead of original.
Original comment by sergey.m...@gmail.com
on 23 Feb 2011 at 10:37
Attachments:
i close this issue since it is fixed in svn.
please also make sure to set tablePrefix => '' on the db component to let
everything run properly
Original comment by thyseus
on 16 Mar 2011 at 8:22
I still get the same exception "The table "{{users}}" for active record class
"YumUser" cannot be found in the database. "
but I have just downloaded your last version from svn and I dont use
table_prefix. what can be the problem? am I doing smt wrong?
Original comment by mustafah...@gmail.com
on 29 Jun 2011 at 7:25
after replacing UserModule.php I get this error:
include(YumMessage.php): failed to open stream: No such file or directory
Original comment by mohamada...@gmail.com
on 18 Jul 2011 at 7:31
I also see the same error after replacing UserModule.php
Original comment by engg.ri...@gmail.com
on 5 Aug 2011 at 1:01
This error makes me angry to developers :)
So, I download User Manager Module fo Yii but I cann't use it cause of errors,
and for the current moment this management module is incompetent
Original comment by yura888...@gmail.com
on 5 Sep 2011 at 5:30
Hello,
Any news on the yummessage.php cannot open stream problem?
Original comment by b.tuinma...@gmail.com
on 8 Nov 2011 at 10:59
I have the same problem about YoumMessage.php please help
Original comment by propel...@gmail.com
on 21 Feb 2012 at 1:44
I have the same problem about YoumMessage.php
Original comment by ashraf.a...@gmail.com
on 29 Mar 2012 at 3:50
all becouse table have name 'user' - not 'users'.
Original comment by vasilyev...@gmail.com
on 13 Apr 2012 at 12:44
hey,.any update for YoumMessage.php: cant open stream?
Original comment by eliemaga...@gmail.com
on 15 Jul 2012 at 9:14
Please make sure that you have the following in your application configuration:
'user' => array(
'usersTable' => 'user',
...
Original comment by rikirusd...@gmail.com
on 20 Aug 2012 at 3:54
i want YumMessage.php....
include(YumMessage.php): failed to open stream: No such file or directory
After replacing UserModule.php for urs over originals
Original comment by rkram...@aucventures.com
on 12 Oct 2012 at 6:12
Simply change the line $this->_tableName = '{{users}}'; to $this->_tableName =
'{{user}}'; in models/user/model/YumUser.php . Thanks and enjoy :)
Original comment by sahaniya...@gmail.com
on 9 Jan 2013 at 6:27
Original issue reported on code.google.com by
sergey.m...@gmail.com
on 26 Jan 2011 at 9:33