Skip to content

Commit

Permalink
LPD-6977 Namespace needs to only be passed to the element name attribute
Browse files Browse the repository at this point in the history
Otherwise PortletRequestImpl.java#_processCheckbox won't process the checkbox correctly because checkboxNames will have a namespace and the value doesn't.
  • Loading branch information
thektan authored and brianchandotcom committed Mar 21, 2024
1 parent 57eeff9 commit d686b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ protected Map<String, Object> prepareProps(Map<String, Object> props) {
props.put("type", _type);
}

props.put("value", _value);
if (Validator.isNotNull(_value)) {
props.put("value", _value);
}

if (Validator.isNotNull(_offSymbol) || Validator.isNotNull(_onSymbol)) {
JSONObject symbolJSONObject = JSONFactoryUtil.createJSONObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ export default function Toggle({
helpText,
label,
locale: _locale,
name,
offLabel,
onLabel,
portletId: _portletId,
portletNamespace: _portletNamespace,
toggled: _initialToggled,
value,
...otherProps
}) {
const [toggled, setToggled] = useState(_initialToggled);
Expand All @@ -45,8 +47,10 @@ export default function Toggle({
)}
</>
}
name={_portletNamespace + name}
onToggle={setToggled}
toggled={toggled}
value={value ?? toggled ? 'on' : undefined}
{...otherProps}
/>
);
Expand Down

0 comments on commit d686b0b

Please sign in to comment.