Verify if item is downloadable before downloading it to get better error messages in Joomla for subscriptions
svenbluege opened this issue · 4 comments
By using an installer plugin and the method onInstallerBeforePackageDownload
I can update paid extensions.
But the update will fail if the DownloadID is invalid. The Joomla error message is very useless and I want to improve this by checking the DownloadID in the onInstallerBeforePackageDownload
method before using it.
I have two ideas how to do this:
- add a dummy release + item which contains a simple text file and needs a subscription level to get downloaded.
- ARS supports in the Item controllers download task a parameter like "checkOnly=true". Instead of downloading the item, it would return [success|failed]. A dedicated task might work as well.
If the check succeeds, onInstallerBeforePackageDownload
can modify the URL. Otherwise it would attach a message like "Subscription expired, blabla".
In both cases, we would end up with additional entries in the download logs since logging failed download attempts might still be a good idea.
What do you think? Is there maybe a third way which is already in place?
I get your point and will check the database way. Thanks for the feedback!
I hit this page because I was also considering using the onInstallerBeforePackageDownload
method as mentioned by @svenbluege . Now I understand that this may be a bad idea. However, when I have a subscription-based purchase that expires, I would really like to redirect the updating website to a web page of mine where he/she can renew the subscription when the update fails. How could that be done without a onInstallerBeforePackageDownload
process? My extension already includes a system plug-in, so an additional function is not a problem.