?
avatar viocassel
viocassel
13 Feb 2016

When in the editor, use the button "+ module", then at the end of the shortcode appears not need a comma.
qdgs3oz

avatar viocassel viocassel - open - 13 Feb 2016
avatar joomline
joomline - comment - 13 Feb 2016

Yes, I also have this bug.

avatar dgt41
dgt41 - comment - 13 Feb 2016

@viocassel this is NOT a bug:
For the load position:

    /**
     * Loads and renders the module
     *
     * @param   string  $position  The position assigned to the module
     * @param   string  $style     The style assigned to the module
     *
     * @return  mixed
     *
     * @since   1.6
     */
    protected function _load($position, $style = 'none')

and for the load module:

    /**
     * This is always going to get the first instance of the module type unless
     * there is a title.
     *
     * @param   string  $module  The module title
     * @param   string  $title   The title of the module
     * @param   string  $style   The style of the module
     *
     * @return  mixed
     *
     * @since   1.6
     */
    protected function _loadmod($module, $title, $style = 'none')

or both here:
https://github.com/joomla/joomla-cms/blob/staging/plugins/content/loadmodule/loadmodule.php#L122-L163

So both functions can accept one more parameter, style. When empty a null is passed. This was by design NOT a bug

avatar Ilya-Zhulin
Ilya-Zhulin - comment - 13 Feb 2016

Ho-ho-ho! The code should consider if next parameter exists, isn't it? Functions which you show allow to keep last parameter empty. Why do you argue?

avatar dgt41
dgt41 - comment - 13 Feb 2016

@Ilya-Zhulin to put it simple if empty the value will be none: protected function _loadmod($module, $title, $style = 'none'), so why spent processing power to take that coma off? It doesn't make any sense...

avatar Ilya-Zhulin
Ilya-Zhulin - comment - 13 Feb 2016

No problem! If it is hard to devs, we can delete it by self.. Every time, time by time... And.. somewhere in Joomla! 3.5.9 somebody put this if condition...
If you mean that style is neccessary - put 'none' it to code automatically if the style field is empty. To finish frase by comma - that really doesn't make sense

avatar dgt41
dgt41 - comment - 13 Feb 2016

If you are willing to make that change here is the code:

var extraVal;
if (jQuery("#extra_class").val().length)
{
extraVal =  "," + jQuery("#extra_class").val();
} else {
extraVal =  "";
}
        moduleIns = function(type, name) {
            parent.window.jInsertEditorText("{loadmodule " + type + "," + name + extraVal + "}", "' . $editor . '");
            parent.window.jModalClose();
        }
        modulePosIns = function(position) {
            parent.window.jInsertEditorText("{loadposition " + position +  extraVal  + "}", "' . $editor . '");
            parent.window.jModalClose();
        }

should replace these lines: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_modules/views/modules/tmpl/modal.php#L49-L57

avatar Ilya-Zhulin
Ilya-Zhulin - comment - 13 Feb 2016

Yes, we did it. This post was to remind developers to change it in release.

avatar dgt41
dgt41 - comment - 13 Feb 2016

@Ilya-Zhulin I don't see the PR

avatar Ilya-Zhulin
Ilya-Zhulin - comment - 13 Feb 2016

ah.. You need PR... Sorry, this id for devs, not from devs. Somewhere I learn JS enough to make pull request for this

avatar richard67
richard67 - comment - 14 Feb 2016

@viocassel @joomline @Ilya-Zhulin If you find some time, please test this PR https://issues.joomla.org/tracker/joomla-cms/9117 made by @dgt41 and set the test result in the issue tracker.


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

avatar richard67
richard67 - comment - 14 Feb 2016

@viocassel ... and if all works you can close this issue here :smiley:


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

avatar viocassel
viocassel - comment - 14 Feb 2016

I have tested this. Everything works fine :smile:

avatar brianteeman brianteeman - close - 14 Feb 2016
avatar viocassel viocassel - change - 14 Feb 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-02-14 17:21:17
Closed_By viocassel
avatar viocassel viocassel - close - 14 Feb 2016
avatar brianteeman brianteeman - change - 8 Mar 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment