User tests: Successful: Unsuccessful:
Currently the "Install from URL" and "Install from WEB" tasks fail in some special cases.
Try the "Install from URL" task with the following URL:
https://github.com/jtester/TestExtension/archive/1.0.zip
Expected: Installation successful
Actual: Unable to find install package
Download the package first and install via "Upload"
Expected: Installation successful
Actual: Installation successful
Apply the patch
The "Install from URL" task should work now.
Ref: Old bug tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33316
it worked perfectly
Umm, I didn't expect this...
The "special case" I am talking about is actually what GitHub is doing here.
It took me a while to figure out why it doesn't work (for me), but since you asked for the details, here they are
The URL
https://github.com/jtester/TestExtension/archive/1.0.zip
does not point to a "real file" but triggers the GitHub build thingy generating a redirect to:
https://codeload.github.com/jtester/TestExtension/zip/1.0
passing the filename in the header:attachment; filename=TestExtension-1.0.zip
Note that there are no quotes so this code:
https://github.com/joomla/joomla-cms/blob/master/libraries/cms/installer/helper.php#L63
$contentfilename = explode("\"", $response->headers['Content-Disposition']);
$target = $contentfilename[1];
will fail miserably, producing also a PHP notice when accessing the item 1 of an array with 1 entry... all this happens silently leaving the URL path as a fall back:/path/to/joomla/tmp/1.0
with the resulting file name1.0
Since JArchive relies on the file extension, it can not unpack a file with the extension 0
, resulting in a Exception with the message: Unknown Archive Type
which is also silently ignored...
Final result: "Unable to find install package"
Now, why this happens to me and not to you, I have honestly no idea.
If you have debugging capabilities, please set a breakpoint in the installer helper #64
, otherwise could you just hack a
echo $response->headers['Content-Disposition'];die;
in there ?
Another test (which is why this is bugging me...) Could you switch to the "Install from web" tab - the JED thingy - and search for the "EasyCreator" extension? Does this also install OK?
Thanks for testing :)
yes easy creator installs fine
Not sure I added the echo correctly but it gave
Notice: Undefined offset: 1 in /Applications/MAMP/htdocs/newjab/libraries/cms/installer/helper.php on line 64
attachment; filename=TestExtension-1.0.zip
Now I am even more confused since you even get the notice I was talking about...
Could I ask you again to hack a
echo $target; die;
and then
echo $url; die;
at the end of the method (before the return statement)?
In my case this gives me the URL /path/to/joomla/tmp/1.0
leading to the errors described.
Thanks again ;)
Sorry do you mean making the code look like
// Return the name of the downloaded package
echo $target; die;
echo $url; die;
return basename($target);
like this:
// Bump the max execution time because not using built in php zip libs are slow
@set_time_limit(ini_get('max_execution_time'));
print_r(array($target, $url)); die;
// Return the name of the downloaded package
return basename($target);
Array ( [0] => /Applications/MAMP/htdocs/newjab/tmp/1.0.zip [1] => https://github.com/jtester/TestExtension/archive/1.0.zip )
That's not what I expected either... but you still get the notice ?
Your output contains the original URL while mine contains the URL from the redirect e.g.Array ( [0] => /home/elkuku/repos/joomla-cms/tmp/1.0 [1] => https://codeload.github.com/jtester/TestExtension/zip/1.0 )
I'm lost :(
Yes i still get the notice
Sorry I cant help any further
Maybe related to PHP version?
I can reproduce the issue on my test server and patch fixes the issue.
I was testing locally on PHP Version 5.4.10
Just tested on my live server PHP Version 5.3.28 and got the error
Tested both on PHP 5.3.23 and 5.4.20 and got the error. So it's likely not related to that
I'm on PHP 5.5.9 ;)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-02-26 14:40:45 |
What are the "special cases" that it will fail on. I just tried "Install from URL" task with the following URL:
https://github.com/jtester/TestExtension/archive/1.0.zip
and it worked perfectly