dsghpgmay31938863 2013-10-24 12:38
浏览 37
已采纳

Joomla - 新添加的usre寄存器字段值不在getUser()中

I've added new field call user_type to the users table in joomla 2.5 user component. And updated 'libraries\joomla\user\user.php' file and .xml file for the new filed.

When I register with new filed it will work fine and update the new database field with new form value. But when it call getUser() array that new field value is empty. I just print the array as

$user = JFactory::getUser();
print_r($user);

All other fields have value like below:

JUser Object
(
    [isRoot:protected] => 
    [id] => 231
    [name] => miu
    [usre_type] => 
    [username] => miu
    [email] => s@l.test

Why that usre_type field value not come to the array? Is there any file, getUsre() need to update?

  • 写回答

1条回答 默认 最新

  • donglinxia1541 2013-10-24 12:43
    关注

    I believe there is a typo.

    You added a column in the database table called user_type, however the array displays usre_type. Note the r and the e are the wrong way round.

    Check the user.php and .xml file and correct this mistake

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺