?
avatar bertmert
bertmert
18 May 2016

Joomla 3.5.1

Expected behavior

When you click button Discover in view
administrator/index.php?option=com_installer&view=discover
all entries in database table xy_extensions with state = -1 ("not installed yet") should be deleted before webspace is checked for not installed extensions.

Actual behavior

When a folder with not installed extension is removed from webspace after it was found with button Discover it's always displayed in view
administrator/index.php?option=com_installer&view=discover

Testing Instructions

  • Create folder /plugins/content/discovertest/
  • Create file /plugins/content/discovertest/discovertest.xml
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.5" type="plugin" group="content" method="upgrade">
<name>discovertest</name>
<files>
<filename plugin="discovertest">discovertest.php</filename>
</files>
</extension>
  • Backend: Goto administrator/index.php?option=com_installer&view=discover
  • Click button Discover.
  • New item in view/list: discovertest. Don't install!
  • Have a look in database table xyz_extensions
  • You'll see an entry (highest extension_id) with state -1 and name discovertest.

  • Delete new folder above.

  • Click button Discover.
  • Nothing has changed in list of view and in database. Still an entry discovertest (that's not installable and not present anymore in webspace).

None of the methods discover() (libraries/cms/installer/[adapter] or com_installer itself) is calling a purge() method. All are just setting state = -1 but never remove them if outdated.

avatar bertmert bertmert - open - 18 May 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 18 May 2016
avatar bertmert
bertmert - comment - 19 May 2016

This solution doesn't output any error message if purge() returns a false. I don't know if the discover procedure should stop then or not, output a message or not.
EDIT: Or if a

if (!$model->purge())
{
 ...
}

would be better in controller;
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_installer/controllers/discover.php#L29
with a

$model->_message

inside setRedirect();

avatar Bakual
Bakual - comment - 19 May 2016

@bertmert Andre ist right, just add that line back where he said. It was his PR #9114 which removed the line accidentally in the discover method.

avatar infograf768
infograf768 - comment - 19 May 2016

Anyone creates the PR?

avatar bertmert
bertmert - comment - 19 May 2016

Test #10558 please.

avatar bertmert bertmert - change - 19 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-19 15:01:28
Closed_By bertmert
avatar bertmert bertmert - close - 19 May 2016
avatar brianteeman brianteeman - close - 19 May 2016
avatar brianteeman brianteeman - change - 27 May 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment