? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
12 Aug 2019

Summary of Changes

This adds validation capability to Joomla\CMS\Form\Field\AccessLevelField by generating field options in field's getOptions() method instead of in the layout.

Testing Instructions

Modify administrator/components/com_content/forms/article.xml to add validate="options" attribute to access field:

<field
	name="access"
	type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	validate="options"
/>

Test A:

Edit an article.
Save the article.

Test B:

Edit an article.
Using browser's developer tools, edit the markup of access field to add invalid value, e.g.:

<option value="111111" selected="selected">Public</option>

Save the article.

Expected result

A) Article saved successfully.

B) Saving article fails with warning:

Invalid field: Access

Actual result

A) Saving article fails with warning:

Invalid field: Access

B) Saving article fails with warning:

Invalid field: Access

Documentation Changes Required

Maybe.

avatar SharkyKZ SharkyKZ - open - 12 Aug 2019
avatar SharkyKZ SharkyKZ - change - 12 Aug 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Aug 2019
Category Administration com_content Layout Libraries
avatar SharkyKZ SharkyKZ - change - 12 Aug 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 12 Aug 2019
avatar SharkyKZ SharkyKZ - change - 12 Aug 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 12 Aug 2019
avatar SharkyKZ SharkyKZ - change - 12 Aug 2019
Labels Added: ?
avatar wilsonge
wilsonge - comment - 12 Aug 2019

Looks very sensible to me - just needs a test. No docs required :)

avatar richard67
richard67 - comment - 12 Aug 2019

@SharkyKZ Am confused. On a clean, new install of 4.0-dev, I proceed as described and get the expected result without having this PR applied. What am I doing wrong?

avatar SharkyKZ
SharkyKZ - comment - 12 Aug 2019

@richard67 Have you modified the article form for testing purposes?

avatar richard67
richard67 - comment - 12 Aug 2019

@SharkyKZ Yes, I did everything exactly as described in testing instructions. Or does it need some extra step? Is that XML cached somewhere in DB? I mean I did even logout and login again to make sure the modified XML is read.

avatar SharkyKZ
SharkyKZ - comment - 12 Aug 2019

Without patch, after modifying form saving always fails. I'll update instructions for both cases.

avatar richard67
richard67 - comment - 12 Aug 2019

Can it be that actual result and expected result in testing instruction are mixed up?

I assume actual result = "article can be saved without any warning" is what I should get without this PR applied, and expected result = "article can't be saved, warning is shown" is what I should get with this PR applied.

But if it is vice versa, the testing instructions are wrong. But then I would not understand the test, because I assume you want to show that validation of the "111111" value fails with this PR and does not fail without.

avatar richard67
richard67 - comment - 12 Aug 2019

Ah I see you just answered.

avatar SharkyKZ SharkyKZ - change - 12 Aug 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 12 Aug 2019
avatar richard67
richard67 - comment - 12 Aug 2019

I have tested this item successfully on e640463


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

avatar richard67 richard67 - test_item - 12 Aug 2019 - Tested successfully
avatar wilsonge wilsonge - change - 19 Aug 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-19 13:42:50
Closed_By wilsonge
avatar wilsonge wilsonge - close - 19 Aug 2019
avatar wilsonge wilsonge - merge - 19 Aug 2019
avatar wilsonge
wilsonge - comment - 19 Aug 2019

Thanks!

Add a Comment

Login with GitHub to post a comment