?
avatar demis-palma
demis-palma
4 Jun 2015

When a module extension is disabled in "Extension Manager", all the instances of existing modules appear unpublished in module manager list. On the contrary, they appear published if you enter editing one of them.

On the modules list, if the user clicks on the red cross or the "Publish" button in the toolbar, a message shows that the module has been successfully published, while looking at he module list, it still seems unpublished.
At this point, the user, which doesn't know that the extension has been disabled, can't know the reason why the module persists unpublished while the message says that it has been published.

screenshot1
Screenshot 1: In module list it seems unpublished

screenshot1
Screenshot 1: In editing mode the same module seems published

How to reproduce

Described by astridx below.

Solution proposed

  1. The state of the module should reflect its actual state, that is "Extension disabled" rather than "Unpublished". This implies an icon different from the red cross.
  2. When trying to enable the module, the message should be "Can't publish the module while the extension is disabled"

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar demis-palma demis-palma - open - 4 Jun 2015
avatar zero-24 zero-24 - change - 4 Jun 2015
Title
Paradox: Module state published and unpublished at the same time
Paradox: Module state published and unpublished at the same time
avatar zero-24 zero-24 - change - 4 Jun 2015
Category Administration UI/UX
avatar zero-24 zero-24 - change - 4 Jun 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 4 Jun 2015
Labels Added: ?
Build master staging
avatar astridx
astridx - comment - 9 Jun 2015

I can confirm that behavior.
Steps I reproduced the issue while I use the English test data:
1. I checked that the Module Banners is active in Extensions | Module Manager.
2. Extensions | Extensions Manager | Manage -> I disabled the Banner Module
3. Now the Module Banners is unpublished in Extensions | Module Manager.
4. I click on the red cross and I find the message “1 module successfully published”, although no Module was published. The Module Banners is still unpublished.


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

avatar zero-24 zero-24 - change - 9 Jun 2015
Status New Confirmed
avatar astridx
astridx - comment - 14 Jun 2015

I had a quicker look at this issue and I think the main problem is, that it is possible to disable an extension also there is a published module. That’s why the editing view is OK. Only the module list is wrong.
I found a solution for this failure in the module list view. First I realized, that in
\joomla-cms\administrator\components\com_modules\models\modules.php
on line 240 the query measured the value for published. It combined the published value from modules with the enabled value from the extension table.

    $query->select(
        $this->getState(
            'list.select',
            'a.id, a.title, a.note, a.position, a.module, a.language,' .
                'a.checked_out, a.checked_out_time, **a.published+2*(e.enabled-1) as published,** a.access, a.ordering, a.publish_up, a.publish_down'
        )
    );

This leads to showing not the right values for published in this view.

I would suggest these changes in the file
\joomla-cms\administrator\components\com_modules\models\modules.php:

    $query->select(
        $this->getState(
            'list.select',
            'a.id, a.title, a.note, a.position, a.module, a.language,' .
                'a.checked_out, a.checked_out_time, **a.published as published, e.enabled as enabled,** a.access, a.ordering, a.publish_up, a.publish_down'
        )
    );

So the value for published is not changed and is consistent with the table, but we can use the enabled value of the extension table.

The second change is in the view file
\joomla-cms\administrator\components\com_modules\views\modules\tmpl\default.php

Here I would show Icons only, if the extension is enabled:

                    <td class="center">
                        <?php 
                        **if ($item->enabled>0)**
                        {
                            echo JHtml::_('grid.id', $i, $item->id); 
                        }
                        ?>
                    </td>
                    <td class="center">
                        <div class="btn-group">
                            <?php
                            **if ($item->enabled>0)**
                            {
                                echo JHtml::_('jgrid.published', $item->published, $i, 'modules.', $canChange, 'cb', $item->publish_up, $item->publish_down); 

                                // Create dropdown items
                                JHtml::_('actionsdropdown.duplicate', 'cb' . $i, 'modules');

                                $action = $trashed ? 'untrash' : 'trash';
                                JHtml::_('actionsdropdown.' . $action, 'cb' . $i, 'modules');

                                // Render dropdown list
                                echo JHtml::_('actionsdropdown.render', $this->escape($item->title));
                            }
                            ?>
                        </div>
                    </td>

So, in the module list view there would not show any icon. You can see an example in the attached file.

Is this a solution for this problem?

Should I open another issue for the problem, that it is possible to disable an extension, also there is a published module?

I am very new here. How can I attach this code to this issue?


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

avatar astridx
astridx - comment - 14 Jun 2015

attachement


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

avatar astridx
astridx - comment - 14 Jun 2015

screen shot 2015-06-14 at 08 09 54


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

avatar Bakual
Bakual - comment - 20 Jun 2015

Closing as we have a PR.

avatar Bakual Bakual - change - 20 Jun 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-06-20 15:11:45
Closed_By Bakual
Build master staging
avatar Bakual Bakual - close - 20 Jun 2015

Add a Comment

Login with GitHub to post a comment