Open Tsheke opened 1 year ago
mergeusers form screenshots
Thanks @Tsheke for your contribution.
It seems quite good.
However, before integrating your PR into this plugin, please, consider the following comments and ammendments suggestions:
user_filter_profilefield::get_profile_fields()
always return a first element named 0 => 'any field'
. This item is also present on the plugin settings. So:
any field
in the plugin settings, index_form.php should consider any existing profile field.user_filter_profilefield::get_profile_fields()
only returns an array of one element 0 => 'any field'
, this should be considered as additional profile field is not available. settings.php should show only None
and nothing else.user_filter_profilefield::get_profile_fields()
returns more than one element, and in settings.php is selected any field
(value 0
), index_form.php should gather all real profile fields from user_filter_profilefield::get_profile_fields()
(excluding 0 => 'any field'
as if admin selected all existing profile fields from the list.$advanced
is undefined. I suppose you meant to be true
.In addition, I think we could improve your proposal by adding any allowed user profile field to be added into the existing initial selector, as with the rest Idnumber
, Email address
and so on. The name could be of the form profile_field_3
, visible name Custom profile 1
and value search pattern
, when looking for the user profile field with id = 3 (i.e., having profile_field_
as prefix always, and 3
or any given number, as the field id). Then, when submitting the form, we would look into the pattern profile_field_
and if match we will take the given number as the field.id being search by.
This way, this part would not be hidden as an advanced item, but as a main part, included into the existing selector for id, idnumber, email and so on. I think it would be very benefitial for admin users indeed.
Let me know if you can afford this change.
Thanks for your contribution,
Jordi
By the way,
Please, @Tsheke, add some PHPUnit tests to validate your new part. Thanks!
Jordi
Hi @jpahullo , Thanks you for the feedback. I made changes you suggested. Some variables was renammed for validation with the codechecker. This is mainly removing Camel Style and/or underscrore to have all in lower case. For the last improvement you suggeted, it's a good idea, but we can check it later when we get some free time. I could add the PHP unit test later too.
Thank you so much and let me know what you think about the pull request. Johnny.
Once you @Tsheke make the requested changes, we will run the workflow to make the latest checkings.
Please, add tests for this profile fields part too.
Many thanks for the work!
Hi @jpahullo , Here are changes you requested + php unit test. Would you like to have look please? Thank you.
Hi @Tsheke,
Thanks for the effort.
It seems quite good right now. You do not considered a comment about the settings.php file though.
In addition, I have to test it locally and validate the whole solution. I will be back once I can with more information.
Thanks again,
Jordi
Hi @ndunand ,
Would you like to merge this request please? We added support to make search by custom user profile fields:
How to test the new fonctionnality:
Thank you.