User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Introducing 2 new shortcuts:
// Load the default behaviours for singular form
JHtml::_('formbehavior.singular');
// Load the default behaviours for plural form
JHtml::_('formbehavior.plural');
Purpose: DRY
Also clean up some scripts
Nothing breaks in the admin area
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_admin com_associations com_banners com_categories com_config com_contact com_content com_fields com_finder com_languages com_menus |
Why load behavior.core
with the new methods? Do we need it other than for behavior.formvalidator
which already takes care of its dependancies itself?
Also why load the tabstate, tooltips and keepalive? If I don't need those in my form, they should not be loaded. Looking at your diif we haven't loaded them in many places before so I question the need for always loading them.
I agree with @wilsonge that it looks a bit pointless to have two methods that do the same except for the added multiselect. If anything, it could be a switch (eg $multiselect = false
) in single method.
@Bakual about
The actual implementation might not be the perfect one, but the idea of having one call for each of the different views (singular, plural) makes some sense to me, not only it's DRYier but also is easier for new devs to pick up...
As always that's my personal view and it might not reflect the projects aims
The only thing DRY about it is not having a chain of several JHtml calls. I don't see the need for two separate methods which are loading the same scripts. A flag is more than enough on one method.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-13 12:08:24 |
Closed_By | ⇒ | dgt41 | |
Labels |
Added:
?
|
What's the advantage of this over having a single method for this helper and additionally calling multiselect in the "plural" view