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

SearchKit - Fix saving created/modified fields #26484

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jun 9, 2023

Overview

Fixes saving created/modified info when updating a savedSearch in SearchKit.

Before

  1. Edit a search
  2. The name of the last-modified user ought to be set to you, but instead it is unchanged.

After

Fixed.

Technical Details

Don't select created/modified id or date fields when loading SavedSearch so they don't get sent back as values. The BAO will then be free to auto-fill them.

Comments

I think there are some larger issues here where we need to teach APIv4 not to mess with fields set to <readonly> in the schema. But this PR is the most minimal change and can be safely merged regardless of what other stuff we end up doing.

Don't select created/modified id or date fields when loading SavedSearch so they don't get sent back
as values. The BAO will then be free to auto-fill them.
@civibot
Copy link

civibot bot commented Jun 9, 2023

(Standard links)

@civibot civibot bot added the master label Jun 9, 2023
@monishdeb
Copy link
Member

I have tested in the test build http://core-26484-3ypkt.test-1.civicrm.org:8001 (admin / xY5kZ8DLN9nZ) and it looks good to me. The modified date is now updated correctly:
after1

In this demo I tested with another user who modified one of the existing searchkit criteria and the modified date was rightfully updated.

@monishdeb monishdeb merged commit 0b1e9d6 into civicrm:master Jun 9, 2023
@colemanw colemanw deleted the searchKitModified branch June 9, 2023 03:55
@colemanw
Copy link
Member Author

colemanw commented Jun 9, 2023

Thanks for merging @monishdeb !

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

Successfully merging this pull request may close these issues.

2 participants