If you use a uri temporary:// is set to : "sites/mysite/private/temp"
-> not a full path !!!
The function "Download Theme" not working.
I receive this error :
localhost
Error
Error message
Exception: Unable to open in write mode '' in Archive_Tar->_error() (line 635 of /opt/lampp/drupal-local/modules/system/system.tar.inc).
The website encountered an unexpected error. Please try again later.
It is because the fonction"drupal_realpath" used at line 514 return NULL VALUE.
In line 509 : $destination = $destination . '/' . $name . '.tar'
return "temporary::/omega-tools/MYTHEME.tar"
In "drupal_realpath" drupal uses the PHP function realpath, but this function return NULL if the path not exist... Here the filename THEME.tar is not yet create.
Archive_Tar receive a NULL value for the destination.
I have patched the module with this code :
Create a new variable for the tar destination :
$tardest = drupal_realpath($destination) . '/' . $name . '.tar';
$archiver = new Archive_Tar($tardest);
With this modification it works well.
Comment | File | Size | Author |
---|---|---|---|
#15 | null_path_theme_tarball_download-1492588-2.patch | 663 bytes | joelcollinsdc |
#1 | null_path_theme_tarball_download-1492588-1.patch | 788 bytes | ankur |
Comments
Comment #1
ankur CreditAttribution: ankur commentedI encountered the same fatal PHP error.
The fix described above worked for me.
Here's a patch that implements it. Instead of naming the variable $tardest, I called it $realpath_destination
Comment #2
mrgoodcheese CreditAttribution: mrgoodcheese commentedHow do I use the attached patch? Or in what file do I place the code? Sorry, but I'm a bit new to this, and experienced the same download error.
Thank you.
Comment #3
ankur CreditAttribution: ankur commented@mrgoodcheese
If you are comfortable at the command line on a Unix-based operating system, you can use the "patch" utility.
Otherwise, you can edit the file by hand using the the uploaded patch file as a guide. The lines with a "-" in front of them are lines you remove and the lines with a "+" in front of them are lines you add (of course, you don't want to include the actual "+" or "-") in the removed/added lines. The patch file says you want to make these edits inside the function "omega_tools_write_archive", the definition of which begins at around line 505 (it's line 505 in the version of the .module file against which I created the patch file).
If you've never created/applied patches using the command-line or a version control system, I'd go the manual route.
Comment #4
xurizaemonWorks as advertised, thanks.
To reproduce: Use the "Download theme" link from the theme settings page.
Comment #5
mrgoodcheese CreditAttribution: mrgoodcheese commentedThanks for you help so far, ankur. I've tried modifying the file, but I must be doing something wrong because it doesn't work and I still get the same error as before. Is there any chance that I could get you to put up a link to the modified file, or email the file to me? I really want to get this working, and it would be much appreciated.
mrgoodcheese@gmail.com
Comment #6
xurizaemon@mrgoodcheese it's worth learning how - http://drupal.org/patch/apply
Comment #7
PlayfulWolf CreditAttribution: PlayfulWolf commentedapplied patch, but my browser cannot finish the file - it shows it on downloaded bar for infinite amount of time.
Comment #8
Rudi91 CreditAttribution: Rudi91 commentedI've tried both the method used in the original post aswell as the one in the #1 post (the one with the patch file).
I'm pretty sure I've adjusted the file as mentioned in the post and tried out both but neither of them seem to work.
My error message is slightly different but this is the only post I've found that comes close to it.
My error message goes as follows;
Error message
Exception: File 'test' does not exist in Archive_Tar->_warning() (line 644 of
myurl/modules/system/system.tar.inc).The website encountered an unexpected error. Please try again later.
Has anyone managed to find another fix or should I open a new topic for this one?
Comment #9
sreher CreditAttribution: sreher commentedI installed the patch and in the first place it doesn't work.
After i try it several times, i discover that when i choose a name with only one word, it works.
If there is a space in the name, it doesn't work for me.
Perhaps it helps...
Comment #10
Rudi91 CreditAttribution: Rudi91 commentedThanks sreher,
I got it working using a single word as well.
I've also tried it with underscores instead of spaces but that didn't work either.
Comment #11
joelcollinsdc CreditAttribution: joelcollinsdc commented+1 for this working if no spaces, not working if spaces
Comment #12
fubhy CreditAttribution: fubhy commentedI removed this feature in 4.x because I had the feeling that noone really used it. Is there any demand for me to put this in 4.x?
Comment #13
fubhy CreditAttribution: fubhy commentedComment #14
hotwebmatter CreditAttribution: hotwebmatter commented@ fubhy:
For what it's worth, I just tried to use the "Download Theme" feature and got the same error message (which is how I ended up here), so +1 "I'm interested in this feature."
"Demand" seems like a pretty strong word for my feelings on the issue, though -- I certainly figured out another way to download the theme.
Comment #15
joelcollinsdc CreditAttribution: joelcollinsdc commentedRerolling the patch because i'm trying to apply 2 patches to the same file and they are dying on the no newline at the end of file.
Comment #16
traveller CreditAttribution: traveller commentedPatch in #15 works for me. Thanks!
Comment #17
PlayfulWolf CreditAttribution: PlayfulWolf commentedapplied #15 manually - download works now
Comment #18
xurizaemonIf testing patches, please consider marking RTBC once you've reviewed them.
Comment #19
PlayfulWolf CreditAttribution: PlayfulWolf commentedI applied patch manually: some of the lines were NOT correct, and I applied only the content of #15 - it may need to apply manually also.
If that is RTBC, I am marking this.
Comment #20
xurizaemonSeems to work OK via simplytest.me with temporary directory set to sites/default/files/tmp. No warnings about patch not applying.
Comment #21
wickwood CreditAttribution: wickwood commentedPatch in #15 applied with git cleanly to 7.x-3.0-rc4 and fixed the problem for me.
Comment #22
radimklaskaPatch #15 works OK. Thanks!
Comment #23
pmmto CreditAttribution: pmmto commentedPatch #15 works for me. Thanks!