User tests: Successful: Unsuccessful:
This adds validation capability to Joomla\CMS\Form\Field\AccessLevelField
by generating field options in field's getOptions()
method instead of in the layout.
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.
A) Article saved successfully.
B) Saving article fails with warning:
Invalid field: Access
A) Saving article fails with warning:
Invalid field: Access
B) Saving article fails with warning:
Invalid field: Access
Maybe.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Layout Libraries |
Labels |
Added:
?
|
@richard67 Have you modified the article form for testing purposes?
Without patch, after modifying form saving always fails. I'll update instructions for both cases.
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.
Ah I see you just answered.
I have tested this item
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-08-19 13:42:50 |
Closed_By | ⇒ | wilsonge |
Thanks!
Looks very sensible to me - just needs a test. No docs required :)