No Code Attached Yet
avatar PhilETaylor
PhilETaylor
15 May 2021

Steps to reproduce the issue

This is a pure PHP issue, that doesn't effect Joomla core, but Joomla core provides and exposes this API for others to use.

A developer can add an edit button on a List view to allow editing of items. In fact the default addToolbar method in the MVC layer of Joomla also provides this edit button

You can replicate this by adding ToolbarHelper::editList('article.edit'); to the Articles HtmlView.php toolbar and then checking all your articles and then clicking edit.

Expected result

When using ToolbarHelper::editList('article.edit'); API, the page checks with javascript how many items are checked, before submitting the form.

The expected behaviour is like this (in the versions modal)

Screen.Recording.2021-05-15.at.02.17.42.pm.mp4

If more than one item is checked, then you are told to only select one item to edit

Actual result

No validation of the checkboxes number checked, and form submits and the edit page of the first item checked is loaded.

Screen.Recording.2021-05-15.at.02.16.32.pm.mp4
avatar PhilETaylor PhilETaylor - open - 15 May 2021
avatar joomla-cms-bot joomla-cms-bot - change - 15 May 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 May 2021
avatar PhilETaylor PhilETaylor - change - 15 May 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 15 May 2021
avatar eopws
eopws - comment - 15 May 2021

When using ToolbarHelper::editList('article.edit'); API, the page checks with javascript how many items are checked, before submitting the form.

Maybe it's better to make the button disabled when more than one checkbox checked?

avatar chmst
chmst - comment - 15 May 2021

This was already 2008 when I made my first Joomla installation. Nobody had a problem with that until now.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33905.

avatar brianteeman
brianteeman - comment - 17 May 2021

Actually I've always had a problem with it and its been reported several times but always rejected

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

reported several times but always rejected

I dont know why - it is clearly wrong and should be fixed. However now that Joomla 4 no longer has any edit buttons, it might be just as easy to deprecate the edit toolbar completely instead.

avatar joeforjoomla
joeforjoomla - comment - 19 May 2021

The edit button for an items list is used widely by extensions developers, but the behavior has always been almost the same on J3. The only difference is that J4 does not enable the edit button when the check all checkbox is clicked, but only when single items are selected one by one. Then the first item is edited. Probably it would be the time to make this behavior consistent in J4, for example introducing a JS validation... i guess that the best option would be to prevent the form to submit if there are multiple items selected.

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

Probably a quick easy fix in JS for @dgrammatiko :)

avatar dgrammatiko
dgrammatiko - comment - 19 May 2021

Probably a quick easy fix in JS for @dgrammatiko :)

I'll call @Fedik for this one :)

avatar PhilETaylor PhilETaylor - change - 7 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-07 18:37:14
Closed_By PhilETaylor
Labels Added: No Code Attached Yet
Removed: ?
avatar PhilETaylor PhilETaylor - close - 7 Mar 2022

Add a Comment

Login with GitHub to post a comment