? Pending

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
24 Feb 2017

Pull Request for Issue # .

Summary of Changes

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

Testing Instructions

Nothing breaks in the admin area

Documentation Changes Required

avatar dgt41 dgt41 - open - 24 Feb 2017
avatar dgt41 dgt41 - change - 24 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2017
Category Administration com_admin com_associations com_banners com_categories com_config com_contact com_content com_fields com_finder com_languages com_menus
avatar wilsonge
wilsonge - comment - 25 Feb 2017

What's the advantage of this over having a single method for this helper and additionally calling multiselect in the "plural" view

avatar Bakual
Bakual - comment - 27 Feb 2017

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.

avatar dgt41
dgt41 - comment - 27 Feb 2017

@Bakual about

  • core.js: you are right
  • tooltips: well right now there are already loaded in the index.php (which is wrong), also load them in the singular form is wrong, the right place is in every field. For list views is needed

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 ?

avatar mbabker
mbabker - comment - 27 Feb 2017

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.

avatar dgt41 dgt41 - change - 13 Mar 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-03-13 12:08:24
Closed_By dgt41
Labels Added: ?
avatar dgt41 dgt41 - close - 13 Mar 2017

Add a Comment

Login with GitHub to post a comment