? ? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
9 Apr 2017

Summary of Changes

Background

If you have a commercial extension (or want to add dynamic parameters to your update call) you can relay on the "extra_query" field from this patch or use a "installer" plugin which was implemented in this patch. But that means, if you have an plugin/module/extension you'll have to ship an extra update plugin or adjust the database row with (e.g.) credentials.

The Idea

A lot of components/Modules shiping a helper file which can be used for a lot of additional tasks (like language associaction in components or Ajax calls in Modules). With this patch a developer cann add a "prepareUpdate" method to his/her helper file which will be called before the download of the update will be started. That means, the method could augment the download url with own parameters on the fly (e.g. append a key) without shipping an update plugin.
Also for plugins itself it looked strange for me to ship an plugin for updating a plugin. So this patch just make sure, that the plugin itself is loaded, so the update call can be implemented in the plugin itself.

Testing Instructions

That's the hard part:
First you need a component/module/plugin which supports the update functionallity from Joomla!.
Second you need an older version of this extension, so the update process can be triggert.
Last but not least you have to adjust the helper file or (if you test a plugin) the plugin itself:

Component com_example:

Go to administrator/components/com_example/helpers/example.php, make sure you have a class ExampleHelper and add the following method:

/**
 * Method to add parameters to the update
 *
 * @param   JUpdate       $update  An update definition
 * @param   JTableUpdate  $table   The update instance from the database
 */
public static function prepareUpdate($update, $table)
{
    exit('works');
}

Module mod_example:

Go to (administrator)/modules/mod_example/helper.php, make sure you have a class modExampleHelper and add the following method:

/**
 * Method to add parameters to the update
 *
 * @param   JUpdate       $update  An update definition
 * @param   JTableUpdate  $table   The update instance from the database
 */
public static function prepareUpdate($update, $table)
{
    exit('works');
}

Pluginplg_example:

Just add the following trigger to your plugin

public function onInstallerBeforePackageDownload($url, $headers)
{
    exit('works');
}

Now if you execute the update, the different methods should be triggered (depending on the type of your extension)

Votes

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

avatar bembelimen bembelimen - open - 9 Apr 2017
avatar bembelimen bembelimen - change - 9 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2017
Category Administration com_installer
avatar bembelimen bembelimen - change - 9 Apr 2017
Labels Added: ?
avatar bembelimen
bembelimen - comment - 9 Apr 2017

Thank you @Quy and @zero-24

avatar zero-24 zero-24 - test_item - 9 Apr 2017 - Tested successfully
avatar zero-24
zero-24 - comment - 9 Apr 2017

I have tested this item successfully on 07ea152

? Works good here on my end. I have tested all three plugin, module and component.


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

avatar chmst chmst - test_item - 9 Apr 2017 - Tested successfully
avatar chmst
chmst - comment - 9 Apr 2017

I have tested this item successfully on 07ea152

Tested successfully and a Really great idea :)


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

avatar Didldu-Florian
Didldu-Florian - comment - 10 Apr 2017

I have also tested this item successfully on 07ea152
Both Joomla! 3.6.5 and 3.7 RC1

avatar franz-wohlkoenig franz-wohlkoenig - change - 10 Apr 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 10 Apr 2017

RTC after 3 successful tests.

avatar rdeutz rdeutz - change - 10 Apr 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-04-10 15:06:45
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 10 Apr 2017
avatar rdeutz rdeutz - merge - 10 Apr 2017
avatar zero-24
zero-24 - comment - 10 Apr 2017

@bembelimen can you create a doc page for that new feature? Just ping me if i can help you :)

Add a Comment

Login with GitHub to post a comment