You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the two integer fields called price and price_de. When I request the value of price with language de, it only provides the correct value if price_de is any other than empty or greater than 0.
Expected behavior
While I would expect an empty field to fall back to the value of the default language, having a value 0 should actually return 0.
Actual behavior
When price_de has a value of 0, it returns the value of price.
Optional: Suggestion for a possible fix
The problem lies in LanguageSupportFields.module on line 159, where empty() is used to determine if the field has a value. It seems to me that !(isset($value) && $value !== '') should be used there.
Setup/Environment
ProcessWire 3.0.165
The text was updated successfully, but these errors were encountered:
@dsdsdsdsdsds Thanks, I've pushed a fix for this. Note that in your integer field settings, on the Details tab, for the "Are 0 and blank equivalent?" field, you'll have to select "No - blank and 0 have different meanings".
Short description of the issue
I have the two integer fields called price and price_de. When I request the value of price with language de, it only provides the correct value if price_de is any other than empty or greater than 0.
Expected behavior
While I would expect an empty field to fall back to the value of the default language, having a value 0 should actually return 0.
Actual behavior
When price_de has a value of 0, it returns the value of price.
Optional: Suggestion for a possible fix
The problem lies in LanguageSupportFields.module on line 159, where
empty()
is used to determine if the field has a value. It seems to me that!(isset($value) && $value !== '')
should be used there.Setup/Environment
ProcessWire 3.0.165
The text was updated successfully, but these errors were encountered: