Project

General

Profile

Actions

Bug #3762

closed

J2.5+J3.0: When user params are not displayed in fronted, they revert to default values on save

Added by beat over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
05 November 2012
Due date:
% Done:

100%

Estimated time:
2:00 h

Description

To reproduce:
- Set front-end language to non-default one
- Set in CB config user profile: "Allow user to edit his CMS parameters in frontend" to NO.
- Edit and save user in frontend
- See that front-end language reverted to default.

Actions #1

Updated by beat over 11 years ago

This is due to a Joomla bug which doesn't handle save properly (only halfways does so) when $user->params is untouched as a string and not as an array.

Bug in Joomla is in libraries/joomla/user/user.php in function bind:

if (array_key_exists('params', $array))
{
$params = '';
$this->_params->loadArray($array['params']);
if (is_array($array['params']))
{
$params = (string) $this->_params;
}
else {
$params = $array['params'];
}
$this->params = $params;
}

The line $this->_params->loadArray($array['params']);
should be pushed down in the case of $array['params'] being an array, and a separate line should be added for the other case.

That makes that a Joomla bug.

Workaround is to never pass an untouched string: either null or the params as an array, same as when saving in frontend with params enabled.

Actions #2

Updated by beat over 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed in r1912 .

Actions #3

Updated by beat over 11 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF