User tests: Successful: Unsuccessful:
Pull Request for Issue #17001
Revert #15724
Set some User Profile plugin fields for registration and administrator user forms to Optional and Required.
Details in #17001 (comment)
The frontend Registration and backend Create User obey to the plugin parameters
All fields are presented as Optional and the TOS link is missing.
By reverting #15724, which purpose was to Refill fields when there is an error in the registration
, we lose this nice feature BUT it breaks badly the user profile settings.
These settings have priority imho over #15724
Any other solution which would keep the feature is welcome.
@bembelimen
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_users |
I will let this open and make the beta release, next week we have a RC1 and we have time to fix it meanwhile.
I looked into it. The first PR was a fix for the broken behaviour, so that the data remains in the form. The problem is, that the data loading is a bit strange. But I try to take the time the next days.
So I took the time and found the exact problem.
For the description I have to go deeper into the code:
First of all, Joomla! has a kind of Singleton for loading forms. Means, all forms will be only loaded once (and so the prepareForm trigger will only called once)
This behavior is achieved by creating an unique signature for each form, so each form will be initialised only once: Code. In general that is a good idea, but the problem here is, that the options are a part of this signature, especially the "load_data" parameter.
That means, that the same form will be handle as completly new form, when we first load without data and then with data (which makes no sense).
So my patch did not add a bug, but triggers an existing one. The solution could be:
$sigoptions = $options;
if (isset($sigoptions['load_data']))
{
unset($sigoptions['load_data']);
}
// Create a signature hash.
$hash = md5($source . serialize($sigoptions));
(Replace the line from the link above)
@andrepereiradasilva
Your proposal works perfectly when registering in front-end.
When creating a new user in backend though (is it another bug? recent, ancient ?) the required fields are not set such. All enabled fields (Optional/Required) are displayed the same (without the term Optional or Star for Required)
Do you mean my proposal? The backend was not touched, so it shouldn't work before and after the patch (if it's broken)
@andrepereiradasilva
please create new pr with your patch and i will close this one.
OOps, in fact my call was to @bembelimen sorry
Closing as there is a PR. Thnaks.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-13 19:40:38 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
|
I will look into it today evening or tomorrow!