Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create User Record now hides the Password field and uses the check isUserRegistrationPermitted - which prevents Administrators from setting passwords for new Users #20274

Merged
merged 1 commit into from
May 19, 2021

Conversation

agileware-justin
Copy link
Contributor

@agileware-justin agileware-justin commented May 12, 2021

Overview

Create User Record now hides the Password field and uses the check isUserRegistrationPermitted - which prevents Administrators from setting passwords for new Users.

See Gitlab for more deets, https://lab.civicrm.org/dev/core/-/issues/2605

Before

Password fields no longer shown. This change was introduced by #18982 and
633d512

Screenshot_20210512_161318

After

Password fields are again shown.

Screenshot_20210512_161416

Technical Details

Comments

The comment was "Also removes the possibility to set a user-defined password for WordPress users." - this change affects all CMS not just WordPress.

Agileware Ref: CIVICRM-1737

@civibot
Copy link

civibot bot commented May 12, 2021

(Standard links)

@civibot civibot bot added the master label May 12, 2021
@kcristiano
Copy link
Member

As I commented on the Issue, we should respect the WP settings which send magic links. I do not think we should revert and regress.

This change affects both admin forms and front end forms and the user experience should match what WP current convetion is.

@christianwach
Copy link
Member

I agree with @kcristiano - better to query $config->userFramework to refine this.

@christianwach
Copy link
Member

Also, might as well wrap 'ERROR: Password mismatch' and 'Password is required' in ts() while you're at it @agileware-justin 😁

@agileware-justin
Copy link
Contributor Author

Just re-iterating that the change in the original PR
PR #18982 the intention was to change the behaviour for WordPress only, "Also removes the possibility to set a user-defined password for WordPress users."

However, the change affected all CMS not just WordPress.

With this change, only WordPress has the changed behaviour and other CMS are no longer affected.

Other feedback incorporated.

@kcristiano still a thumbs down mate?

@agileware-justin
Copy link
Contributor Author

The split between Gitlab and PRs is a tad annoying sometimes. Gitlab, https://lab.civicrm.org/dev/core/-/issues/2605

@kcristiano
Copy link
Member

@agileware-justin I fixed the emoji :)

I'll test with WP. I'll also add to d7master and see what happens there. Can you confirm the expected behavior with Drupal is to ask a user for a password on a form that has registration required? Same for back end of D7?

@agileware-justin
Copy link
Contributor Author

agileware-justin commented May 13, 2021

Can you confirm the expected behavior with Drupal is to ask a user for a password on a form that has registration required? Same for back end of D7?

The expected behaviour is how it used to work in CiviCRM for Drupal. 😃

@christianwach
Copy link
Member

Looks good to me based on reading alone. Thanks for wrapping the text in ts() @agileware-justin.

@kcristiano
Copy link
Member

I have done r-run on Drupal 7 and WP.

This restores behavior in Drupal prior to 5.37.0 and WP is working as intended.

Thanks @agileware-justin

This is merge-ready. @eileenmcnaughton I do think this is a regression and if we can target 5.37 it would be in order.

@demeritcowboy
Copy link
Contributor

If it's a regression then this should be rebased against 5.38 first, then would be backported to 5.37. @agileware-justin are you able to rebase it? It might work to just edit the title and change the target branch but sometimes it then adds 100 bogus commits.

I have some r-code comments since it could be more OO-ey, but since this is already tested that could be a followup later.

@eileenmcnaughton
Copy link
Contributor

@jusfreeman - did you spot the rebase against the 5.38 rc branch? So we can port & do a 5.37 release with this

@agileware-justin agileware-justin changed the base branch from master to 5.38 May 18, 2021 22:29
@civibot civibot bot added 5.38 and removed master labels May 18, 2021
@agileware-justin agileware-justin changed the base branch from 5.38 to master May 18, 2021 22:30
@civibot civibot bot added master and removed 5.38 labels May 18, 2021
@agileware-justin agileware-justin changed the base branch from master to 5.38 May 18, 2021 22:51
@civibot civibot bot added 5.38 and removed master labels May 18, 2021
@eileenmcnaughton
Copy link
Contributor

thanks @jusfreeman

… the check isUserRegistrationPermitted - which prevents Administrators from setting passwords for new Users
@agileware-justin
Copy link
Contributor Author

@eileenmcnaughton please use @agileware-justin for pings - I don't use or monitor the other one you are using there

Can't maintainers just cherry pick a commit into any branch? Seems would be much easier.

@eileenmcnaughton
Copy link
Contributor

@agileware-justin ok sure & no - the github UI doesn't offer us any quick & easy way to cherry-pick from one PR to another branch

@agileware-justin
Copy link
Contributor Author

agileware-justin commented May 18, 2021

@agileware-justin ok sure & no - the github UI doesn't offer us any quick & easy way to cherry-pick from one PR to another branch

GitHub Desktop supports cherry picking from branches https://desktop.github.com/
And you can also do this in PHP Storm if you login to Github.

Here's the announcement, GitHub Desktop now supports cherry-picking
https://github.blog/2021-03-30-github-desktop-now-supports-cherry-picking/
desktop/desktop#1685

Alternately, having a FAQ for rebasing against different CiviCRM version would be useful and you could get CiviBot to refer people to it. Would save everyone's time too.

Forgot the @eileenmcnaughton

@eileenmcnaughton
Copy link
Contributor

Yeah - there are tonne of different ways to do it - I would probably in this case - if it had been my branch - have done a get reset --hard against 5.38 & then cherry-picked it on & then done a force push. If I was creating a new branch / pr instead I would have checked out 5.38, cherry-picked the commit & then pushed & opened a PR

If you take a look at the links that gitbot adds above you can add whatever docs you would have found helpful as a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants