diff --git a/administrator/manifests/packages/pkg_weblinks.xml b/administrator/manifests/packages/pkg_weblinks.xml deleted file mode 100644 index f8699dcaaecd2..0000000000000 --- a/administrator/manifests/packages/pkg_weblinks.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - pkg_weblinks - weblinks - December 2012 - Joomla! Project - (C) 2005 - 2016 Open Source Matters. All rights reserved. - admin@joomla.org - www.joomla.org - Joomla! Project - admin@joomla.org - www.joomla.org - 3.4.1 - GNU General Public License version 2 or later; see LICENSE.txt - PKG_WEBLINKS_XML_DESCRIPTION - - - com_weblinks.zip - mod_weblinks.zip - plg_finder_weblinks.zip - plg_search_weblinks.zip - - - en-GB/en-GB.pkg_weblinks.sys.ini - - - - https://raw.githubusercontent.com/joomla-extensions/weblinks/master/manifest.xml - - diff --git a/plugins/authentication/facebook/facebook.php b/plugins/authentication/facebook/facebook.php index 29026f809dbd9..0804f81d6226c 100644 --- a/plugins/authentication/facebook/facebook.php +++ b/plugins/authentication/facebook/facebook.php @@ -132,7 +132,7 @@ public function onAjaxFacebook() $userId = JUserHelper::getUserIdByEmail($fbUserEmail); } - if ($userId == 0) + if (empty($userId)) { $usersConfig = JComponentHelper::getParams('com_users'); $allowUserRegistration = $usersConfig->get('allowUserRegistration'); @@ -412,7 +412,25 @@ protected function getUserIdByFacebookId($fbUserId) { $id = $db->setQuery($query, 0, 1)->loadResult(); - return empty($id) ? 0 : $id; + // Not found? + if (empty($id)) + { + return 0; + } + + /** + * If you delete a user its profile fields are left behind and confuse our code. Therefore we have to check + * if the user *really* exists. However we can't just go through JFactory::getUser() because if the user + * does not exist we'll end up with an ugly Warning on our page with a text similar to "JUser: :_load: + * Unable to load user with ID: 1234". This cannot be disabled so we have to be, um, a bit creative :/ + */ + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('COUNT(*)')->from($db->qn('#__users')) + ->where($db->qn('id') . ' = ' . $db->q($id)); + $userExists = $db->setQuery($query)->loadResult(); + + return ($userExists == 0) ? 0 : $id; } catch (Exception $e) {