NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
22 Oct 2020

Fixes #31194.

Summary of Changes

Fixes validation of required checkboxes.

Testing Instructions

node build/build.js --compile-js required.

Add a checkboxes field with required attribute to some form. E.g. edit plugins/editors/codemirror/codemirror.xml to add required="true" attribute to fullScreenMod field:

<field
	name="fullScreenMod"
	type="checkboxes"
	label="PLG_CODEMIRROR_FIELD_FULLSCREEN_MOD_LABEL"
	required="true"
	>
	<option value="Shift">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_SHIFT</option>
	<option value="Cmd">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_CMD</option>
	<option value="Ctrl">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_CTRL</option>
	<option value="Alt">PLG_CODEMIRROR_FIELD_VALUE_FULLSCREEN_MOD_ALT</option>
</field>

Edit Editors - CodeMirror plugin.
Try to save it with no options selected in Toggle Fullscreen Modifier field.

Actual result BEFORE applying this Pull Request

Form is submitted.

Expected result AFTER applying this Pull Request

Form is not submitted, message is shown:

Error
The form cannot be submitted as it's missing required data.
Please correct the marked fields and try again.

Documentation Changes Required

No.

avatar SharkyKZ SharkyKZ - open - 22 Oct 2020
avatar SharkyKZ SharkyKZ - change - 22 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2020
Category JavaScript Repository NPM Change
avatar SharkyKZ SharkyKZ - change - 22 Oct 2020
The description was changed
avatar SharkyKZ SharkyKZ - edited - 22 Oct 2020
avatar SharkyKZ SharkyKZ - change - 22 Oct 2020
The description was changed
avatar SharkyKZ SharkyKZ - edited - 22 Oct 2020
avatar SharkyKZ SharkyKZ - change - 22 Oct 2020
The description was changed
avatar SharkyKZ SharkyKZ - edited - 22 Oct 2020
avatar SharkyKZ SharkyKZ - change - 22 Oct 2020
Labels Added: NPM Resource Changed ?
avatar Didldu-Florian Didldu-Florian - test_item - 22 Oct 2020 - Tested successfully
avatar Didldu-Florian
Didldu-Florian - comment - 22 Oct 2020

I have tested this item successfully on 66c5aac

@SharkyKZ this works fine, but I noticed another general problem.
The js validation works only by renderField() not by only ->getInput()
Because its placed at the label and if you use only ->getInput() without ->getLabel() the validation works not.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31196.

avatar SharkyKZ
SharkyKZ - comment - 22 Oct 2020

The validation works. Only inline message is not shown because there's nowhere to show it. Open a new issue if you want.

avatar Quy Quy - test_item - 22 Oct 2020 - Tested successfully
avatar Quy
Quy - comment - 22 Oct 2020

I have tested this item successfully on 66c5aac


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31196.

avatar Quy Quy - change - 22 Oct 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 22 Oct 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31196.

avatar rdeutz rdeutz - change - 27 Oct 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-27 13:12:47
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 27 Oct 2020
avatar rdeutz rdeutz - merge - 27 Oct 2020

Add a Comment

Login with GitHub to post a comment