You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the case in PHP 5.2.6, (please reproduce on other versions)
My user table is named "users" (with extra S at end), when you setup config and specify in users module the "userTable" argument specifying value: "users" then and exception occurs because table "user" (without the "s") is not present in database. It looks like YumUser model dont recognize the passed argument: "users", instead using "user" by default.
you can observe in YumUser, the "user" argument is specifyed by default, assuming no other value is present, but, the value "IS PRESENT" in config, why it dont recognize ?, please continue reading.
Looking deeply in YumUser.php, i set some debug lines in YumUser that demostrate what's happening in that method. As you can observe, the problem is "if (isset(Yum::module()->userTable))" who is always returning false, no matter if the config value is present or not.
Then a simple solution is not using "isset", but it can derive in an exception (try/catch ?) if user dont specify the userTable argument in it own config file.
in file : \code\ecommerce\protected\modules\user\models\YumUser.php, method:
public function tableName()
{
if (isset(Yum::module()->userTable)) {
$this->_tableName = Yum::module()->userTable;
Yii::log("tableName MARK #1,","info");
}
else {
$this->_tableName = 'user'; // fallback if nothing is set
Yii::log("tableName MARK #2,","info");
}
Yii::log("tableName is: ".$this->_tableName,"info");
throw new Exception("STOP HERE - EXCEPTION",500);
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
The text was updated successfully, but these errors were encountered:
the old ResolveTableName() method is a relict from the old age, when yii-user-management was one BIG module
rather than many small, like it is now. I will keep it simply for all other submodules and tables, too.
This is the case in PHP 5.2.6, (please reproduce on other versions)
My user table is named "users" (with extra S at end), when you setup config and specify in users module the "userTable" argument specifying value: "users" then and exception occurs because table "user" (without the "s") is not present in database. It looks like YumUser model dont recognize the passed argument: "users", instead using "user" by default.
you can observe in YumUser, the "user" argument is specifyed by default, assuming no other value is present, but, the value "IS PRESENT" in config, why it dont recognize ?, please continue reading.
Looking deeply in YumUser.php, i set some debug lines in YumUser that demostrate what's happening in that method. As you can observe, the problem is "if (isset(Yum::module()->userTable))" who is always returning false, no matter if the config value is present or not.
Then a simple solution is not using "isset", but it can derive in an exception (try/catch ?) if user dont specify the userTable argument in it own config file.
in file : \code\ecommerce\protected\modules\user\models\YumUser.php, method:
public function tableName()
{
if (isset(Yum::module()->userTable)) {
$this->_tableName = Yum::module()->userTable;
Yii::log("tableName MARK #1,","info");
}
else {
$this->_tableName = 'user'; // fallback if nothing is set
Yii::log("tableName MARK #2,","info");
}
The text was updated successfully, but these errors were encountered: