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

Error when displaying the messages of requirements on password updating #9033

Open
SinergiaCRM opened this issue Feb 10, 2021 · 3 comments
Open
Labels
Area: Module Issues & PRs related to modules that do not have specific label Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type: Bug Bugs within the core SuiteCRM codebase

Comments

@SinergiaCRM
Copy link
Contributor

SinergiaCRM commented Feb 10, 2021

Issue

With the following settings enabled in password management:

  • Password should contain uppercase characters
  • Password should contain lowercase characters
  • Password should contain numbers

When creating or updating a user's password, if the above requirements are not met, the CRM tries to show notifications to the user but a javascript error occurs.

Expected Behavior

The CRM should have displayed the messages of:

  • Password should contain uppercase characters.
  • Password should contain numbers.

Actual Behavior

The following javascript error occurs:

Failed to launch 'location:%20index.php?action=EditView&module=Users&record=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' because the scheme does not have a registered handler.

Possible Fix

In the file: modules/Users/User.php, remove the string "Location: " from the method SugarApplication::redirect (Lines 687, 715 and 719)

Steps to Reproduce

  1. Activate the following parameters in password management
  • Password should contain uppercase characters
  • Password should contain lowercase characters
  • Password should contain numbers
  1. Create or edit a user.
  2. Enter a password that does not meet the requirements of point 1.
  3. Check javascript error in browser console.

Context

Detected while trying to modify the password of a non-administrator user from an administrator user

Your Environment

  • SuiteCRM Version used: Version 7.11.15 - Sugar Version 6.5.25 (Build 344)
  • Browser name and version: Google chrome Versión 88.0.4324.150 (Build oficial) (64 bits)
  • Environment name and version: MySQL, PHP 7.3
  • Operating System and version: Ubuntu 20.04.1 LTS
@johnM2401 johnM2401 added Area: Module Issues & PRs related to modules that do not have specific label Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type: Bug Bugs within the core SuiteCRM codebase labels Feb 11, 2021
@SinergiaCRM SinergiaCRM changed the title Error when displaying the messages of requirements to fulfill when updating a passwod Error when displaying the messages of requirements on password updating Feb 12, 2021
@tahirmolkar
Copy link

In <project_name>\modules\Users\User.php file on line number 687,715&719 remove the "Location"
eg from this return SugarApplication::redirect('Location: index.php?action=Error&module=Users');
to this return SugarApplication::redirect(' index.php?action=Error&module=Users');

@ghost
Copy link

ghost commented Jan 13, 2022

We have followed the steps described above in #9033 (comment)
Errors are now getting displayed, but

  1. CreateView page gets reloaded and all the info User had added gets lost.
  2. User still gets created regardless of password restrictions (6 characters, Must have Lower and Uppercase characters).

@SinergiaCRM
Copy link
Contributor Author

Hi, we have resolved that the user is not created by moving the code that performs the validations (link) before the call to save method (link)

We think that this change can also be added to the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Module Issues & PRs related to modules that do not have specific label Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

3 participants