1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed ErrorException: Undefined index: name

Discussion in 'Resolved Bug Reports' started by Vincent, Feb 12, 2012.

  1. Vincent

    Vincent Well-Known Member

    Error Info:
    ErrorException: Undefined index: name - library/XenForo/ControllerPublic/Register.php:425
    Generated By: Unknown Account, Feb 3, 2012
    Stack Trace
    #0 /home7/.../library/XenForo/ControllerPublic/Register.php(425): XenForo_Application::handlePhpError()
    #1 /home7/.../library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Register->actionFacebook(Object(XenForo_RouteMatch))
    #2 /home7/.../library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch()
    #3 /home7/.../index.php(13): XenForo_FrontController->run()
    #4 {main}
    Request State
    array(3) {
      ["url"] => string(262) "http://www.hlxbans.net/register/facebook?code=AQDu0KlJz2cg73st_DPqDl-9h26JKDPcvBXpo504mnWY2pzigEG0J2vBsToOdNhrYSmVu1AxYsZhBtqm58vKrn02mEVjf5nKNrFf7RJ3n4YdzprAHFQGCA5q0euMg8MyGRCKJyrrwrAtP_TP2aySJRHKbchlSIs059JIgbXYucYNDZB91I2NBxfpig-5a8vX8lBZu1vi8UOQcTeOxbqb4g9p"
      ["_GET"] => array(1) {
        ["code"] => string(216) "AQDu0KlJz2cg73st_DPqDl-9h26JKDPcvBXpo504mnWY2pzigEG0J2vBsToOdNhrYSmVu1AxYsZhBtqm58vKrn02mEVjf5nKNrFf7RJ3n4YdzprAHFQGCA5q0euMg8MyGRCKJyrrwrAtP_TP2aySJRHKbchlSIs059JIgbXYucYNDZB91I2NBxfpig-5a8vX8lBZu1vi8UOQcTeOxbqb4g9p"
      ["_POST"] => array(0) {
  2. digitalpoint

    digitalpoint Well-Known Member

    Probably just can't assume Facebook will always give a user name (obviously).

    If it's causing issues for you now, and can't wait for an official fix, you can change this line:
    $origName $fbUser['name'];
    to this:
    if (!isset($fbUser['name']) $fbUser['name'] = '';
    $origName $fbUser['name'];
    lazy llama, ragtek and Vincent like this.
  3. Vincent

    Vincent Well-Known Member

    It's not that important, I just saw the error and was wondering what it was.
    Appreciatie the fix though, I hope it gets included in 1.1.3 :)
  4. Mike

    Mike XenForo Developer Staff Member

    First time I've ever seen us not get a name from FB, but Shawn's fix is indeed correct/all that can be done.
    ragtek and Vincent like this.
  5. lazy llama

    lazy llama Well-Known Member

    Just a quick note, I may be mistaken by Shawn's fix appears to be missing an extra ")" to close the if condition?
    if (!isset($fbUser['name'])) $fbUser['name'] = '';
    $origName $fbUser['name'];
    Without that, registration attempts get a blank page.
  6. digitalpoint

    digitalpoint Well-Known Member

    Yep... sorry, was just "freehand". :)

Share This Page