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

fix: account terms can be removed if they differ with the ones stored #41120

Merged
merged 2 commits into from Feb 6, 2024

Conversation

jvillafanez
Copy link
Member

@jvillafanez jvillafanez commented Nov 22, 2023

Description

Search terms for the accounts were only updated if new terms were present. However, if terms were removed, we weren't updating the terms.

Related Issue

No opened issue

Motivation and Context

How Has This Been Tested?

  1. Install and configure the user_ldap app (consider default configuration)
  2. Sync the ldap users
  3. Change the "user search attributes" in the ldap wizard and add some attributes (at least 2)
  4. Sync the ldap users again. Note that terms are populated in the "oc_account_terms" table
  5. Remove one of the attributes in the "user search attributes"
  6. Sync the ldap users

Without this patch, the "oc_account_terms" won't change, so the removed attribute can still be searched. With the patch, the table is updated

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

Copy link

update-docs bot commented Nov 22, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link

sonarcloud bot commented Nov 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@pako81 pako81 self-requested a review January 25, 2024 09:57
@pako81
Copy link
Contributor

pako81 commented Feb 5, 2024

@jvillafanez merge or should we ask for a second review?

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it easy to add a test that covers this?

@jvillafanez
Copy link
Member Author

Is it easy to add a test that covers this?

If there aren't already tests for the class, I doubt it's easy

@jvillafanez merge or should we ask for a second review?

Good to merge from my side.

@phil-davis
Copy link
Contributor

If there aren't already tests for the class, I doubt it's easy

Sadly, lib/private/User/Account.php does not have any unit tests.

@phil-davis phil-davis merged commit b9d055a into master Feb 6, 2024
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/remove_account_terms branch February 6, 2024 06:18
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.

None yet

3 participants