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

Use ShowInSearch rather than getField() #40

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

oddnoc
Copy link

@oddnoc oddnoc commented Mar 1, 2023

getField(), unlike hasField(), does not check for the corresponding getter method. This is because getField is itself meant to be called from getter methods. In other words, hasField and getField are not exactly parallel, by design.

This causes any DataObject whose ShowInSearch exists only as a getter to be unconditionally deleted from the index whenever it is saved.

This fix works by replacing the getField call with a reference to ShowInSearch, which will automatically call getShowInSearch.

getField(), unlike hasField(), does not check for the corresponding
getter method. This is because getField is itself meant to be called
from getter methods. In other words, hasField and getField are not
exactly parallel, by design.

This causes any DataObject whose ShowInSearch exists only as a getter to
be unconditionally deleted from the index whenever it is saved.

This fix works by replacing the getField call with a reference to
ShowInSearch, which will automatically call getShowInSearch.
@wilr wilr merged commit f58c91b into WPP-Public:main Mar 2, 2023
@oddnoc oddnoc deleted the hasfield-getfield-fix branch March 3, 2023 19:42
@oddnoc oddnoc mentioned this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants