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

[BUGFIX] false as field value is not allowed #3901

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

dkd-kaehm
Copy link
Collaborator

@dkd-kaehm dkd-kaehm commented Dec 3, 2023

AbstractIndexer::addDocumentFieldsFromTyposcript() disallows any PHPs empty value. This change adds explicit checks for disallowed values:

  • null
  • empty string
  • empty array

Fixes: #3900

AbstractIndexer::addDocumentFieldsFromTyposcript() disallows any PHPs empty value.
This change adds explicit checks for disallowed values:
* null
* empty string
* empty array

Fixes: #3900
@dkd-kaehm dkd-kaehm merged commit 8440800 into main Dec 4, 2023
8 checks passed
@dkd-kaehm dkd-kaehm deleted the bugfix/3900_allow_false_as_field_value branch December 4, 2023 11:18
@mr-typo3
Copy link

I would like to see this change reversed! "FALSE" is also a sensible value that should be saved.

@dkd-kaehm
Copy link
Collaborator Author

dkd-kaehm commented Feb 28, 2024

I would like to see this change reversed! "FALSE" is also a sensible value that should be saved.

@mr-typo3
I don't understand what you mean.
That bugfix must not be reversed, because it explicitly allows the false or 0 values in fields but not empty values.

dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request Mar 7, 2024
This change is a follow-up of TYPO3-Solr#3901, which was introduced to allow following values in Apache Solr fields:
* numeric 0
* boolean false
which lead to countless-unwanted numeric fields with 0 value in Apache Solr documents.
The background: TypoScript can return the strings only, and all empty values lead to numeric 0.

This change tries to avoid mispelled casting of numbers and lets the 
`AbstractIndexer::ensureFieldValueType()` return PHPs `null` if the value isn't a number. 

Relates: TYPO3-Solr#3900, TYPO3-Solr#3901
dkd-friedrich pushed a commit that referenced this pull request Mar 7, 2024
This change is a follow-up of #3901, which was introduced to allow following values in Apache Solr fields:
* numeric 0
* boolean false
which lead to countless-unwanted numeric fields with 0 value in Apache Solr documents.
The background: TypoScript can return the strings only, and all empty values lead to numeric 0.

This change tries to avoid mispelled casting of numbers and lets the 
`AbstractIndexer::ensureFieldValueType()` return PHPs `null` if the value isn't a number. 

Relates: #3900, #3901
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.

[BUG] I found a problem with indexing field with value 0
2 participants