diff --git a/libraries/src/User/User.php b/libraries/src/User/User.php index 2ee81435dfb2f..b52c48785811b 100644 --- a/libraries/src/User/User.php +++ b/libraries/src/User/User.php @@ -896,7 +896,10 @@ public function load($id) * user parameters, but for right now we'll leave it how it is. */ - $this->_params->loadString($table->params); + if ($table->params) + { + $this->_params->loadString($table->params); + } // Assuming all is well at this point let's bind the data $this->setProperties($table->getProperties()); diff --git a/tests/unit/stubs/database/jos_users.csv b/tests/unit/stubs/database/jos_users.csv index 331c61840cdd2..b0ccd74444649 100644 --- a/tests/unit/stubs/database/jos_users.csv +++ b/tests/unit/stubs/database/jos_users.csv @@ -4,3 +4,4 @@ '44','Manager','manager','manager@example.com','b69eafa62e549e5fa875e127fadc3c83:VapLaQZx00iYDRwgMjgsfyIHgoe01DK8','0','1','2010-02-13 00:34:42','2010-02-13 00:34:42','0','{}','0000-00-00 00:00:00','0' '99','Test','test','test@example.com','b69eafa62e549e5fa875e127fadc3c83:VapLaQZx00iYDRwgMjgsfyIHgoe01DK8','0','1','2010-02-13 00:34:42','2010-02-13 00:34:42','0','{}','0000-00-00 00:00:00','0' '100','Activate','activate','activate@example.com','b69eafa62e549e5fa875e127fadc3c83:VapLaQZx00iYDRwgMjgsfyIHgoe01DK8','1','1','2010-02-13 00:34:42','0000-00-00 00:00:00','30cc6de70fb18231196a28dd83363d57','{}','0000-00-00 00:00:00','0' +'101','Empty params','empty-params','empty-params@example.com','b69eafa62e549e5fa875e127fadc3c83:VapLaQZx00iYDRwgMjgsfyIHgoe01DK8','1','1','2010-02-13 00:34:42','0000-00-00 00:00:00','30cc6de70fb18231196a28dd83363d57','','0000-00-00 00:00:00','0' diff --git a/tests/unit/suites/libraries/joomla/user/JUserTest.php b/tests/unit/suites/libraries/joomla/user/JUserTest.php index 0194b279b7e44..3c8d843c0291d 100644 --- a/tests/unit/suites/libraries/joomla/user/JUserTest.php +++ b/tests/unit/suites/libraries/joomla/user/JUserTest.php @@ -397,6 +397,11 @@ public function casesLoad() true, false ), + 'empty-params' => array( + 101, + true, + false + ), 'existing-but-guest' => array( 0, false,