ErrorException in Profile/About

CNK

Active member
Hello, I have xF v2.0.4 in dev and I noticed that few users have strange error in profile page:

Oops! We ran into some problems.
ErrorException: [E_NOTICE] Trying to get property of non-object in src/XF/Pub/Controller/Member.php at line 271
  1. XF::handlePhpError() in src/XF/Pub/Controller/Member.php at line 271
  2. XF\Pub\Controller\Member->actionAbout() in src/XF/Mvc/Dispatcher.php at line 249
  3. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  4. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  5. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
  6. XF\App->run() in src/XF.php at line 328
  7. XF::runApp() in index.php at line 13


1521337755330.webp

but most of profiles work great.



I can't edit this user in xF2:

1521338060086.webp


but in xF1 all works great..
 
Last edited:
with $config['debug'] = false; Profile Page/About works great (shows 'Start conversation' link and 5 trophies), but I still can't edit this user.

An exception occurred: [TypeError] Argument 2 passed to XF\App::getCustomFieldsForEdit() must be an instance of XF\CustomField\Set, null given in src/XF/App.php on line 1583

  1. XF\App->getCustomFieldsForEdit()
  2. call_user_func_array() in src/XF/Template/Templater.php at line 938
  3. XF\Template\Templater->method() in internal_data/code_cache/templates/l1/s0/public/custom_fields_macros.php at line 174
  4. XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 661
  5. XF\Template\Templater->callMacro() in internal_data/code_cache/templates/l1/s0/admin/user_edit.php at line 552
  6. XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 1248
  7. XF\Template\Templater->renderTemplate() in src/XF/Template/Template.php at line 24
  8. XF\Template\Template->render() in src/XF/Mvc/Renderer/Html.php at line 48
  9. XF\Mvc\Renderer\Html->renderView() in src/XF/Mvc/Dispatcher.php at line 332
  10. XF\Mvc\Dispatcher->renderView() in src/XF/Mvc/Dispatcher.php at line 303
  11. XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 44
  12. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
  13. XF\App->run() in src/XF.php at line 328
  14. XF::runApp() in admin.php at line 13


1521338644607.webp

1521339321682.webp


I think there is problem with some custom fields from xF1, unfortunately I can't edit this user in admin cp :(
 
Last edited:
I suspect this might have been broken (though manifesting itself differently) in XF1.

When we've seen this before it has been down to an import process which hasn't correctly created all of the expected user records.
SQL:
INSERT IGNORE INTO xf_user_option (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_privacy (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_profile (user_id) SELECT user_id FROM xf_user;
INSERT IGNORE INTO xf_user_authenticate (user_id) SELECT user_id FROM xf_user;
Running this query is likely to solve the problem, but if you have any ideas how it might have happened, that'd be useful too.
 
Thanks! Now I can edit this user.
I don't know how it happened, in xF1 I have few 'single line box' fields, two 'radio buttons' and one 'drop down selection' field.
 
It's nothing to do with custom fields

Judging by the code, this user didn't have a record in the xf_user_profile table, the query I gave you creates missing records for anyone who doesn't already have one.

Did you import from bbPress at any point?
 
No, I'm using xF1 from 2014 (previously vBulletin from 2009 and phpBB2 from 2005).
This user is from vBulletin times. But maybe it was caused by some error when copying the database? I copied the database from the command line (mysqldump) so it probably should not be a problem.
 
Back
Top Bottom