? Success

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
20 May 2015

Exchange some class names

Most of the PRs that convert the mootools modals to bootstrap use JHtmlBootstrap::renderModal(etc)
but they should actually use JHtml::_('bootstrap.renderModal', etc).
And here is how I found out:
Me: JHtmlBootstrap::renderModal( vs JHtml::('bootstrap.renderModal'
The first one on my IDE with cmd + click on JHtmlBootstrap takes me to the correct file/class but the other takes me to JHtml and cmd + click on 'bootstrap.renderModal' isn’t really helpful as well. So I am a little bit confused here…
@mbabker: JHtml has some code that can let you override the various methods if called via JHtml::
. Direct calling of JHtml (and its subclasses) methods break that functionality. The downside is just as you pointed out, IDE autocompletion is out the window.

So in order to prevent any future conflicts with this code is better to change it ASAP!

Because this is only a rename and some CS work I would like to ask the maintainers to just review and commit. @wilsonge @roland-d ?
To save other people and not to spent their time here, I provide a proof that all the relative modals still work as before. So:
administrator/components/com_contact/models/fields/modal/contact.php
screen shot 2015-05-20 at 3 46 56

administrator/components/com_content/models/fields/modal/article.php
screen shot 2015-05-20 at 3 48 26

administrator/components/com_menus/models/fields/menutype.php
screen shot 2015-05-20 at 3 49 12

administrator/components/com_menus/views/item/tmpl/edit_modules.php
screen shot 2015-05-20 at 3 50 24

administrator/templates/hathor/html/com_menus/menus/default.php
screen shot 2015-05-20 at 3 52 04

administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php
screen shot 2015-05-20 at 3 53 37

administrator/components/com_templates/helpers/html/templates.php
screen shot 2015-05-20 at 3 55 10

administrator/components/com_users/helpers/html/users.php
screen shot 2015-05-20 at 3 57 04

administrator/templates/hathor/html/com_menus/menus/default.php
screen shot 2015-05-20 at 3 59 04

avatar dgt41 dgt41 - open - 20 May 2015
avatar mbabker
mbabker - comment - 20 May 2015

This is definitely a separate CS PR, but mentioning it here because I looked at the diff.

When you have a method call with arguments on multiple lines, you should have one argument per line and the arguments are indented one tab from the opening call. So, something like this:

$html[] = JHtml::_(
    'bootstrap.renderModal',
    'menuTypeModal',
    array(
        'url' => $link,
        'title' => JText::_('COM_MENUS_ITEM_FIELD_TYPE_LABEL'),
        'width' => '800px',
        'height' => '300px',
        'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
    )
);
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 20 May 2015
Category Administration
avatar zero-24 zero-24 - change - 20 May 2015
Status New Pending
Easy No Yes
avatar smz
smz - comment - 21 May 2015

@dgt41 Dimitris, I think you should check here too if the width and height options are needed: here some modals are indeed iframes (and thus they obey to those options), but I'm anyway unsure if it is a good idea (think of high-res displays, like retina displays: what is the behavior with those? I don't have one to check...)

avatar dgt41
dgt41 - comment - 21 May 2015

@smz The only one that is not iframe is the ones in com_templates (the preview image), but lets do that in another PR, this one basically is CS and a class rename. I already did it for the batch @ #7003 but, if you want to help you can always raise a PR

avatar smz
smz - comment - 21 May 2015

@dgt41 OK: Let's not mix too much stuff together. We can wait for this and all your other modal-related are merged and then make an assessment if any needs more "fine tuning"...

avatar wilsonge wilsonge - change - 23 May 2015
Milestone Added:
avatar wilsonge
wilsonge - comment - 23 May 2015

Fix the conflicts please :)

64cac25 23 May 2015 avatar dgt41 CS
bb1da43 23 May 2015 avatar dgt41 tabs
avatar dgt41
dgt41 - comment - 23 May 2015

@wilsonge conflicts solved!

avatar n9iels
n9iels - comment - 25 May 2015

@dgt41 Not sure if this is the right place.
When I add a new menu item, and click on the "Select menu type" button I got the following error:
Notice: Undefined variable: tispanle in C:\MAMP\htdocs\joomla-cms\administrator\components\com_menus\views\menutypes\view.html.php on line 108

Little bug? Or a problem in my local installation?

avatar dgt41
dgt41 - comment - 25 May 2015

@n9iels that should be $title. Let me check how this got there…

avatar dgt41
dgt41 - comment - 25 May 2015

It’s #6467 @n9iels check #7035

avatar ghazal
ghazal - comment - 26 May 2015

If I apply patch #6995 via Joomla! Patch Tester, I get a Fatal Error in :
administrator/components/com_menus/models/fields/menutype.php
Looks like it is a typo on line 89/90, a comma forgotten.
Corrected:

        $html[] = JHtml::_(
            'bootstrap.renderModal',
            'menuTypeModal',
            array(
avatar brianteeman
brianteeman - comment - 26 May 2015

@ghazal I just used the patchtester with this PR and the latest version of joomla staging from github with no problem

avatar dgt41
dgt41 - comment - 26 May 2015

@ghazal thanks

avatar ghazal
ghazal - comment - 26 May 2015

I just wanted to be sure its been corrected. Thanks all for your quick reply.

avatar roland-d
roland-d - comment - 28 May 2015

@brianteeman and @ghazal Did you test this patch successfully?
@n9iels Could you test it again?

avatar ghazal
ghazal - comment - 28 May 2015

Looks like everything works fine.

avatar n9iels
n9iels - comment - 28 May 2015

@test looks good to me!


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

avatar n9iels n9iels - test_item - 28 May 2015 - Tested successfully
avatar wilsonge
wilsonge - comment - 29 May 2015

As this is effectively code style anyhow but also as there are 2 good tests I'm merging this :) Thanks!

avatar wilsonge wilsonge - change - 29 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-29 10:09:27
Closed_By wilsonge
avatar wilsonge wilsonge - close - 29 May 2015
avatar wilsonge wilsonge - close - 29 May 2015
avatar dgt41 dgt41 - head_ref_deleted - 31 May 2015
avatar johanjanssens johanjanssens - reference | ea3901c - 19 Jun 15

Add a Comment

Login with GitHub to post a comment