User tests: Successful: Unsuccessful:
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.
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.
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:
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');
}
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');
}
plg_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)
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_installer |
Labels |
Added:
?
|
I have tested this item
I have tested this item
Tested successfully and a Really great idea :)
Status | Pending | ⇒ | Ready to Commit |
RTC after 3 successful tests.
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:
?
|
@bembelimen can you create a doc page for that new feature? Just ping me if i can help you :)
Thank you @Quy and @zero-24