?
avatar KarstenFrostholm
KarstenFrostholm
27 Apr 2020

Steps to reproduce the issue

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.

Expected result

Its work

Actual result

Not work
It always ends with Joomla\CMS\Form\Field\TextField::validate() rule componentname missing.

System information (as much as possible)

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

Additional comments

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;

/**

  • Form Rule class for the Joomla Platform.

*/
class ComponentnameRule extends FormRule
{

Karsten

avatar KarstenFrostholm KarstenFrostholm - open - 27 Apr 2020
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Apr 2020
avatar KarstenFrostholm KarstenFrostholm - change - 27 Apr 2020
The description was changed
avatar KarstenFrostholm KarstenFrostholm - edited - 27 Apr 2020
avatar SharkyKZ
SharkyKZ - comment - 27 Apr 2020

I can't reproduce the issue. Did you add addruleprefix="xxxxx\Component\zzzz\Administrator\Rule" attribute to your form?

avatar KarstenFrostholm
KarstenFrostholm - comment - 27 Apr 2020

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.

avatar SharkyKZ
SharkyKZ - comment - 27 Apr 2020

I changed the namespace of com_contact to MyVendor\Component\Contact. Still can't replicate the issue.

avatar KarstenFrostholm
KarstenFrostholm - comment - 27 Apr 2020

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.

avatar KarstenFrostholm KarstenFrostholm - close - 27 Apr 2020
avatar KarstenFrostholm KarstenFrostholm - change - 27 Apr 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-04-27 19:05:13
Closed_By KarstenFrostholm

Add a Comment

Login with GitHub to post a comment