using a class ComponentnameRule extends FormRule on this path C:\j4dev\htdocs\administrator\components\com_zzzz\src\Rule\ComponentnameRule.php
with xxxxx as vendor and zzzz as component name, I can't make it work.
Its work
Not work
It always ends with Joomla\CMS\Form\Field\TextField::validate() rule componentname
missing.
Using xampp with php 7.43 running on windows 10.
Joomla_4.0.0-beta1-dev-Development-Full_Package built: Monday, 27 April 2020 02:00:23 UTC
with joomla as vendor and zzzz as component name, its work
From my edit form:
<field
name="name"
type="text"
...
validate="componentname"
required="true"
/>
From top of the validates Rule source:
namespace xxxxx\Component\zzzz\Administrator\Rule;
\defined('_JEXEC') or die;
use Joomla\CMS\Form\FormRule;
/**
*/
class ComponentnameRule extends FormRule
{
Karsten
Labels |
Added:
?
|
Sorry this did not come up in a bug report from the draft:
It looks like it was for the first time but is being eaten by the system
addfieldprefix="xxxxx\Component\zzzz\Administrator\Field"
addruleprefix="xxxxx\Component\zzzz\Administrator\Rule"
have you tried xxxxx as a vendor, not jooml
It was very clear that only joomla as a vendor works. That was the only correction.
xxxxx has been used as a vendor throughout the component.
When my code works, joomla is used throughout the component.
I changed the namespace of com_contact
to MyVendor\Component\Contact
. Still can't replicate the issue.
I do code generation so switching Vendor is easy and I've tried it again and now it works. I'm very confused.
Thank you for checking this matter.
Sorry for wasting your time.
We are going to close this case.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-27 19:05:13 |
Closed_By | ⇒ | KarstenFrostholm |
I can't reproduce the issue. Did you add
addruleprefix="xxxxx\Component\zzzz\Administrator\Rule"
attribute to your form?