? Pending

User tests: Successful: Unsuccessful:

avatar C-Lodder
C-Lodder
15 Feb 2017

Pull Request for Issue #14072

Summary of Changes

In Joomla 4.0, when trying to save a user in the backend, the following error will appear:

Fatal error: Call to undefined method JUser::getParameters() in C:\dev\joomla4\plugins\system\fields\fields.php on line 181

because JUser::getParameters() was removed.

Testing Instructions

Joomla 3.x AND Joomla 4.0

  • Apply patch
  • Try to save a user in the backend
avatar C-Lodder C-Lodder - open - 15 Feb 2017
avatar C-Lodder C-Lodder - change - 15 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
Category Front End Plugins
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

I have tested this item ? unsuccessfully on 14707e7

Works in 3.7, failed in j4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14082.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 15 Feb 2017 - Tested unsuccessfully
avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

@franz-wohlkoenig - hmm not working in J4? Worked perfectly fine for me

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

got Save failed with the following error: Operand should contain 1 column(s)

avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

Are you using Save & Close or just Save?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

Got Error in both Cases.

avatar Bakual
Bakual - comment - 15 Feb 2017

getParameters returns all parameters. getParam returns only one and expects a key to be passed. So you can't use getParam() without any key.
Imho getParameters is deprecated and removed wrongly as there is no method to replace it with the same function.

As for fields. the use could be removed as soon as #13353 is accepted anyway.

avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

Fair enough. Close?

avatar joomdonation
joomdonation - comment - 15 Feb 2017

You just need to remove the command $user->params = (string) $user->getParameters(); and everything still work as expected. So I don't think you should close it

avatar C-Lodder C-Lodder - change - 15 Feb 2017
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

@joomdonation @Bakual - removed the line. Tested again in J4 and working as expected

avatar joomdonation
joomdonation - comment - 15 Feb 2017

No, no , still does't work. There is still error somewhere Save failed with the following error: Operand should contain 1 column(s)

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

Same Error as before.

avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

I dont know how you're both getting this error on J4. I've fetched the latest from the 4.0-dev branch and everything is working for me

avatar joomdonation
joomdonation - comment - 15 Feb 2017

Do you have any custom fields created for user?

avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

nope

avatar joomdonation
joomdonation - comment - 15 Feb 2017

That's why you don't see error. Create a new user custom field, then check it again, you should see the error

avatar C-Lodder
C-Lodder - comment - 15 Feb 2017

So this will only work once #13353 is merged?

avatar joomdonation
joomdonation - comment - 15 Feb 2017

I am not sure. I can try look at the code to see why it doesn't work

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

I have not Custom Field created and have Error.

avatar joomdonation
joomdonation - comment - 15 Feb 2017

This actually is a valid fix. The error which me and @franz-wohlkoenig causes by SQL error in user profile plugin. That could be a separate PR

@franz-wohlkoenig : Please disable User - Profile plugin on Joomla 4, then test it again and report the result back

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

@joomdonation No Error if "User-Profile"-Plugin is disabled.

avatar joomdonation
joomdonation - comment - 15 Feb 2017

Please try to create user custom fields, then check and make sure custom fields data is saved properly. If Yes, you can mark the test as success

avatar joomdonation
joomdonation - comment - 15 Feb 2017

@franz-wohlkoenig PR for fixing the error I and you found is #14088 . Please help testing it as well

avatar Bakual
Bakual - comment - 15 Feb 2017

So this will only work once #13353 is merged?

I can't say if the line is currently needed or not (likely not) as I haven't tested that specific last time I rewrote something in that plugin. I saved that work for after said PR is merged since then it sure isn't needed anymore.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017
  • "User-Profile"-Plugin enabled: Error, but Field is saved.
  • "User-Profile"-Plugin disabled: No Error, Field is saved.

So its fine to mark successfully if "User-Profile"-Plugin disabled?

avatar Bakual
Bakual - comment - 15 Feb 2017

Actually: #14082 would solve this as well as I already remove the line there (didn't remember, sorry) ?

avatar joomdonation
joomdonation - comment - 15 Feb 2017

Yes, correct. This PR could be closed, then

avatar wilsonge
wilsonge - comment - 16 Feb 2017

Closing in favour of #13956

avatar wilsonge wilsonge - change - 16 Feb 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-02-16 10:43:15
Closed_By wilsonge
avatar wilsonge wilsonge - close - 16 Feb 2017

Add a Comment

Login with GitHub to post a comment