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
Describe the bug
When defining a content type, the Checkbox field has a values property that can only be accessed by calling .value instead of .values.
To Reproduce
Steps to reproduce the behavior:
Build content of any content type that includes a Checkbox
Include the following in its container, replacing checkboxVar where appropriate:
The first line's output will look something like this (emphasis mine):
Raw Output: com.dotcms.rendering.velocity.viewtools.content.CheckboxMap@158b5751[options=[Option 1, Option 2, Option 3],values=[1, 2, 3],selectedValues=[1]]
Despite this, the .values call will fail, while the .value call will succeed.
Expected behavior
Expected .values call to work and .value call to fail.
Desktop
OS: macOS Monterey 12.3.1
Browser: Chromium (Brave)
Version: 100.0.4896.127
Additional context .values would better match the object's plural .options and .selectedValues properties, along with the data it prints when called directly. The documentation also listed .values up until today; I adjusted it to match the demonstrated behavior, but I will change it back if that behavior changes.
Could we check whether it was ever .values, perhaps changing some time recently? If I'm wrong and it's always been .value, then perhaps instead the output of $content.checkboxVar should be adjusted to reflect this, and to better maintain backwards compatibility.
E: Looks like it's been this way for years, at least. It'd be a breaking change, albeit a very small and easily-addressed one. Either:
A) End users will need to adjust checkbox calls from .value to .values
B) We can implement both .value and .values
Solution is trivial in all cases; just need to figure out our preference/principle.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
When defining a content type, the Checkbox field has a
values
property that can only be accessed by calling.value
instead of.values
.To Reproduce
Steps to reproduce the behavior:
checkboxVar
where appropriate:.values
call will fail, while the.value
call will succeed.Expected behavior
Expected
.values
call to work and.value
call to fail.Desktop
Additional context
.values
would better match the object's plural.options
and.selectedValues
properties, along with the data it prints when called directly. The documentation also listed.values
up until today; I adjusted it to match the demonstrated behavior, but I will change it back if that behavior changes.Could we check whether it was ever.values
, perhaps changing some time recently? If I'm wrong and it's always been.value
, then perhaps instead the output of$content.checkboxVar
should be adjusted to reflect this, and to better maintain backwards compatibility.E: Looks like it's been this way for years, at least. It'd be a breaking change, albeit a very small and easily-addressed one. Either:
.value
to.values
.value
and.values
Solution is trivial in all cases; just need to figure out our preference/principle.
The text was updated successfully, but these errors were encountered: