No Code Attached Yet
avatar BrainforgeUK
BrainforgeUK
9 Dec 2021

Steps to reproduce the issue

Create a form including a subform.

Include the following setting (as per Joomla standard form field documentation):

validate="SubForm"

Expected result

Subform works.

Actual result

Get error message:

Joomla\CMS\Form\Field\SubformField::validate() rule SubForm missing.

System information (as much as possible)

Works on Windows server, not Linux

Additional comments

https://docs.joomla.org/Subform_form_field_type

The field property needs to be in lower case - the documentation says it is case sensitive but the given value (SubForm) is wrong. It should be:

validate="subform"

Documentation needs correcting.

Even better should the FormHelper::loadRuleType($type) method convert it to lower case regardless?
Impact of doing that on existing usages, including 3rd extensions?

avatar BrainforgeUK BrainforgeUK - open - 9 Dec 2021
avatar joomdonation joomdonation - change - 14 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-14 09:46:32
Closed_By joomdonation
Labels Added: No Code Attached Yet
avatar joomdonation joomdonation - close - 14 Nov 2022
avatar joomdonation
joomdonation - comment - 14 Nov 2022

Updated documentation with necessary change. Please note that the right value to use is validate="Subform" (still case sensitive as state in documentation). It should not be converted to lowercase as you said.

In your case validate="subform" works because the system apply ucfirst to the rule name. But we should still use the right rule name anyway.

I'm closing this issue.

Add a Comment

Login with GitHub to post a comment