? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
10 Jul 2017

Pull Request for Issue #17001

Summary of Changes

Revert #15724

Testing Instructions

Set some User Profile plugin fields for registration and administrator user forms to Optional and Required.
Details in #17001 (comment)

Expected result

The frontend Registration and backend Create User obey to the plugin parameters

Actual result

All fields are presented as Optional and the TOS link is missing.

NOTE:

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

avatar infograf768 infograf768 - open - 10 Jul 2017
avatar infograf768 infograf768 - change - 10 Jul 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jul 2017
Category Front End com_users
avatar bembelimen
bembelimen - comment - 10 Jul 2017

I will look into it today evening or tomorrow!

avatar rdeutz
rdeutz - comment - 11 Jul 2017

I will let this open and make the beta release, next week we have a RC1 and we have time to fix it meanwhile.

avatar bembelimen
bembelimen - comment - 11 Jul 2017

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.

avatar bembelimen
bembelimen - comment - 12 Jul 2017

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)

avatar infograf768
infograf768 - comment - 13 Jul 2017

@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)

avatar bembelimen
bembelimen - comment - 13 Jul 2017

Do you mean my proposal? The backend was not touched, so it shouldn't work before and after the patch (if it's broken)

avatar infograf768
infograf768 - comment - 13 Jul 2017

@andrepereiradasilva
please create new pr with your patch and i will close this one.

avatar infograf768
infograf768 - comment - 13 Jul 2017

OOps, in fact my call was to @bembelimen sorry

avatar bembelimen
bembelimen - comment - 13 Jul 2017

#17122 done

avatar zero-24
zero-24 - comment - 13 Jul 2017

Closing as there is a PR. Thnaks.

avatar zero-24 zero-24 - change - 13 Jul 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-07-13 19:40:38
Closed_By zero-24
Labels Added: ?
avatar zero-24 zero-24 - close - 13 Jul 2017

Add a Comment

Login with GitHub to post a comment