When the "libraries" folder does not exists, libraries installation fails.
This is caused by the FileTansfer::copyDirectoryJailed()
method:
protected function copyDirectoryJailed($source, $destination) {
if ($this->isDirectory($destination)) {
$destination = $destination . '/' . drupal_basename($source);
}
$this->createDirectory($destination);
When the libraries folder does not exist, the first test fails, so the library basename is not added the the destination, which is then sites/all/libraries
instead of the expected sites/all/libraries/mylibrary
. That makes the files to be copied directly in the libraries directories, and the Updater::makeWorldReadable()
method throws an exception when trying to chmod
a directory that does not exist (the famous sites/all/libraries/mylibrary
that was not created).
Not sure it is a bug of FileTranfer, whiwh has its own purpose, or a check that should be performed by Apps...
Hope the following issue will be resolved soon, so the libraries directory could exist by default: https://www.drupal.org/node/667058
So please let me know you thoughts, I would be glad to provide a patch according to your answer.
Comments
Comment #1
hefox CreditAttribution: hefox commentedtrying to clearify title
at this time in life cycle of d7, patch to apps is likely warrented
Comment #3
hefox CreditAttribution: hefox at Phase2 commentedI've modified apps_installer_has_write_access to create the directory if doesn't exist, not sure if this will "fix" it in time as haven't tested it thoroughly
Comment #4
B-Prod CreditAttribution: B-Prod commentedThanks, I will take some time in the following weeks to test the latest DEV version and check if the issue is fixed.