User tests: Successful: Unsuccessful:
Redo of #12399 .
Remove inline scripts:
editor.on('submit', ...)
Test that article save, save and new, save and close and cancel still works
Test that http://j4a.dev/administrator/index.php?option=com_config buttons: save, save and close, cancel still work as expected
Same as before
Same as before
There is one extra data attribute in the form tag named data-cancel-task="string"
, which is required only for forms that the cancel task is not the default e.g. controllerName.cancel
.
This will not affect any 3rd party app, the override still works as before 100% B/C !!!
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_admin com_banners com_categories com_config com_contact com_content com_fields com_finder com_languages com_menus com_messages com_modules com_newsfeeds com_plugins com_redirect com_tags com_templates com_users JavaScript |
@franz-wohlkoenig that's unrelated to this PR, this is a PHP error meaning that the js functioned as expected (the form was submitted) but for some reason the actual save failed.
So although you got an error you have a successful test :)
Labels |
Added:
?
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-18 11:37:21 |
Closed_By | ⇒ | wilsonge |
here was merged 3 issue:
data-cancel-task="string"
It is wrong approach, really wrong. And it need just for skip validation, and nothing more.
Then would be better to improve the toolbar buttons, to allow to define "which action should be validated", see: standard.php#L96 _getCommand
Instead of use data-cancel-task
hack
permissions in the core
why it here at all?
it can be moved to permissions.js easily, see another example permissions.js#L136
var form = document.querySelectorAll( 'form.form-validate' );
this can return multiple forms, BUT you cannot submit them all (without ajax), always will be submitted only last from the array.
Possible solution is use generic id for the content forms, as it was in the past with adminForm
id.
@Fedik the permission part has been already moved to permissions.js
The cancel part needs some touches to the toolbar as the plan is to remove all the crappy inline scripts then that will be fixed there.
For the third issue I guess a simple if id===adminForm will do
The javascript is a WIP, feel free to PR other solution if you feel that the proposed one is not enough ;)
Save
result in Error: