For the "Save & Close" button client-side validations are executed but not for the "Save" button
Client-side validations should be executed for "Save" button and form should not be submitted if the fields in the form contain invalid data
On click of "Save" button even if the form contains invalid data the form is submitted
Joomla 4.0.0-alpha12
Linux server
It seems that the client-side validations are not executed on click of "save" i.e apply button for any of the inbuilt extension except article creation
Code generated or save button for article
<joomla-toolbar-button id="toolbar-apply" task="article.apply" form-validation="">
<button class="button-apply btn btn-sm btn-success" type="button">
<span class="icon-apply" aria-hidden="true"></span>
Save</button>
</joomla-toolbar-button>
Code generated for save button for user creation
<joomla-toolbar-button id="toolbar-apply" task="user.apply">
<button class="button-apply btn btn-sm btn-success" type="button">
<span class="icon-apply" aria-hidden="true"></span>
Save</button>
</joomla-toolbar-button>
form-validation="" is the extra attribute in the button HTML which is missing in "save" button of user creation view
I could reproduce it!
Status | New | ⇒ | Closed - Unconfirmed Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-13 03:37:18 |
Closed_By | ⇒ | Quy |
Status | Closed - Unconfirmed Report | ⇒ | Pending |
Closed_Date | 2019-12-13 03:37:18 | ⇒ | |
Closed_By | Quy | ⇒ |
Same with almost every other form. Contact, Tag, User Note, User Level, etc.
I see 2 options:
Joomla\CMS\ToolbarHelper::apply()
here.Joomla\CMS\Toolbar\CoreButtonsTrait
in Joomla\CMS\Toolbar\ToolbarHelper
.@asika32764 What do you think?
I need check the code, since the HTML side was changed to CE, I' not sure the form validation process how to work with toolbar buttons
It's not to do with CE but with ToolbarHelper
adding a button in a basic way:
joomla-cms/libraries/src/Toolbar/ToolbarHelper.php
Lines 477 to 483 in efca0fb
Instead we can use the trait which also enables validation:
joomla-cms/libraries/src/Toolbar/CoreButtonsTrait.php
Lines 351 to 356 in efca0fb
My question is whether we should make the changes in ToolbarHelper
or remove the uses of ToolbarHelper
in views and use trait methods directly.
I see,
I think we can try proxy ToolbarHelper::apply()
to CoreButtonsTrait::apply()
so that all components which uses ToolbarHelper won't break and keep B/C.
CoreButtonsTrait has already uses by Toolbar
class so we can do like this:
class ToolbarHelper
{
public static apply(...)
{
$bar = Toolbar::getInstance('toolbar');
return $bar->apply(...);
}
}
I cannot reproduce this issue in 4.0.0-beta1-dev. I am using Firefox for the browser and MYSQL for database.
how to know if the client side verification is happening or not ??
can't reproduce the issue
Title |
|
Status | Pending | ⇒ | Confirmed |
Closed_By | SharkyKZ | ⇒ | joomla-cms-bot |
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-01 12:49:12 |
Closed_By | ⇒ | SharkyKZ |
Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/26639
Please test PR #28897.
I could not replicate this error report