Help with accessing extra variables
- johnb
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
6 years 8 months ago #7961
by johnb
Hello,
First let me say your extension is awesome! It works very well.
I've written a plug that has been sorted to execute after yours (during registration). I need to access the extra fields. I'm working within onUserAfterSave. I've tried your access methods:
$user = JFactory::getUser($userid);
plgSystemAJAXRegister::attachExtraFields($user);
JLog::add($user->extra, JLog::ERROR, 'jerror');
JLog reports the extra variable contents as "no" . I am trying to access a text field. Is there some trick to accessing the extra fields?
First let me say your extension is awesome! It works very well.
I've written a plug that has been sorted to execute after yours (during registration). I need to access the extra fields. I'm working within onUserAfterSave. I've tried your access methods:
$user = JFactory::getUser($userid);
plgSystemAJAXRegister::attachExtraFields($user);
JLog::add($user->extra, JLog::ERROR, 'jerror');
JLog reports the extra variable contents as "no" . I am trying to access a text field. Is there some trick to accessing the extra fields?
Please Log in or Create an account to join the conversation.
- johnb
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
6 years 8 months ago #7962
by johnb
I just worked through the code further. It seems your function does not load the last variable into extra. If I add another variable without publish then the code works perfectly.
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
6 years 8 months ago #7963
by Saka
Emir Sakic
www.sakic.net
Not sure about your specific use case but the code does load all extra fields.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.