Your message dated Sun, 13 Dec 2015 23:02:49 +0000
with message-id <[email protected]>
and subject line Bug#783331: fixed in wordpress 4.4+dfsg-1
has caused the Debian Bug report #783331,
regarding wordpress: unable to install theme automatically
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
783331: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783331
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: wordpress
Version: 4.1+dfsg-1
Severity: normal

This was probably reported before but let's start all over again:

I'm trying to add new theme, I click [Install] and got the following error:

    Unpacking the package…
    Could not create directory.

I fix this utterly unhelpful message using the following patch:

~~~~
--- a/wp-admin/includes/file.php
+++ b/wp-admin/includes/file.php
@@ -628,9 +628,9 @@
 
        // Create those directories if need be:
        foreach ( $needed_dirs as $_dir ) {
                if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! 
$wp_filesystem->is_dir($_dir) ) // Only check to see if the Dir exists upon 
creation failure. Less I/O this way.
-                       return new WP_Error( 'mkdir_failed_ziparchive', __( 
'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );
+                       return new WP_Error( 'mkdir_failed_ziparchive', __( 
'Could not create directory '.$_dir ), substr( $_dir, strlen( $to ) ) );
        }
        unset($needed_dirs);
 
        for ( $i = 0; $i < $z->numFiles; $i++ ) {
~~~~

Now error message reveal the first problem:

        Could not create directory /usr/share/wordpress/wp-content/upgrade

Indeed there is no such directory so I create missing symlink which is
probably should be installed by the package:

        ln -sv /var/lib/wordpress/wp-content/upgrade 
/usr/share/wordpress/wp-content/upgrade

Now theme archive is extracted to `/var/lib/wordpress/wp-content/upgrade`
but there is another error:

    Unpacking the package…
    Installing the theme…
    Could not create directory. /usr/share/wordpress/wp-content/themes/yo-manga/
    Theme install failed.

Theme should be installed to `/var/lib/wordpress/wp-content/themes` instead of
`/usr/share/wordpress/wp-content/themes` so I'm trying to address that with the
following sloppy patch:

~~~~
--- a/wp-admin/includes/class-wp-upgrader.php
+++ a/wp-admin/includes/class-wp-upgrader.php
@@ -364,8 +364,14 @@
 
                $source_files = array_keys( $wp_filesystem->dirlist( 
$remote_source ) );
                $remote_destination = $wp_filesystem->find_folder( 
$local_destination );
 
+               $remote_destination =  str_replace(
+                       '/usr/share/wordpress',
+                       '/var/lib/wordpress',
+                       $remote_destination
+               );
+
                //Locate which directory to copy to the new folder, This is 
based on the actual folder holding the files.
                if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( 
trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one 
folder? Then we want its contents.
                        $source = trailingslashit( $args['source'] ) . 
trailingslashit( $source_files[0] );
                } elseif ( count( $source_files ) == 0 ) {

~~~~

Now installation is successful:

    Unpacking the package…
    Installing the theme…
    Successfully installed the theme Yo! Manga 1.4.6.

Here I confirm that theme appears in 
`/var/lib/wordpress/wp-content/themes/yo-manga`
but not in the list of themes in wordpress because the latter completely ignores
`/var/lib/wordpress/wp-content/themes/`. So I make a symlink

    ln -s /var/lib/wordpress/wp-content/themes/yo-manga 
/usr/share/wordpress/wp-content/themes/yo-manga

and only then new theme appears in wordpress.

Unfortunately my PHP knowledge is not sufficient to find how to teach
wordpress to look for themes in `/var/lib/wordpress/wp-content/themes`.

It seems that wordpress needs patching to use themes from
`/var/lib/wordpress/wp-content/themes`.
Package already ship trigger (I think) to symlink everything
from `/usr/share/wordpress/wp-content/themes/` to
`/var/lib/wordpress/wp-content/themes` so already installed themes
will not be affected.

-- 
Cheers,
 Dmitry Smirnov
 GPG key : 4096R/53968D1B

---

The truth is incontrovertible, malice may attack it, ignorance may deride
it, but in the end; there it is.
        -- Winston Churchill

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---
--- Begin Message ---
Source: wordpress
Source-Version: 4.4+dfsg-1

We believe that the bug you reported is fixed in the latest version of
wordpress, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Craig Small <[email protected]> (supplier of updated wordpress package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 11 Dec 2015 21:37:01 +1100
Source: wordpress
Binary: wordpress wordpress-l10n wordpress-theme-twentysixteen 
wordpress-theme-twentyfifteen wordpress-theme-twentyfourteen
Architecture: source all
Version: 4.4+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Craig Small <[email protected]>
Changed-By: Craig Small <[email protected]>
Description:
 wordpress  - weblog manager
 wordpress-l10n - weblog manager - language files
 wordpress-theme-twentyfifteen - weblog manager - twentytfifteen theme files
 wordpress-theme-twentyfourteen - weblog manager - twentyfourteen theme files
 wordpress-theme-twentysixteen - weblog manager - twentysixteen theme files
Closes: 311821 732134 755530 783331 798382
Changes:
 wordpress (4.4+dfsg-1) unstable; urgency=medium
 .
   * New upstream release
   * Add languages directory to install Closes: #798382
   * Update the setup-mysql script to use correct wp-content dirs
     Closes: #755530, #311821, #732134, #783331
   * Updated language files
Checksums-Sha1:
 9e85bca5dac2fa976029e347dec5fb8ac8d7144a 2503 wordpress_4.4+dfsg-1.dsc
 d86a977247844a6c92edf11436b805fd313401d7 5445596 wordpress_4.4+dfsg.orig.tar.xz
 18a7fc4f3cb7489d7c6b62f60dbfa1ce72924531 6054688 
wordpress_4.4+dfsg-1.debian.tar.xz
 669924f3852d48c0feb3a866548551413bb0b306 4362094 
wordpress-l10n_4.4+dfsg-1_all.deb
 0b2c267ac6aa7ad62ae76c4e62340fd52ee6eeb5 502474 
wordpress-theme-twentyfifteen_4.4+dfsg-1_all.deb
 c263d60108872f4d0ee2ec05ab6ee9f127611673 803818 
wordpress-theme-twentyfourteen_4.4+dfsg-1_all.deb
 64180c406b0088030e67adacd33ec6242d399c41 587510 
wordpress-theme-twentysixteen_4.4+dfsg-1_all.deb
 54d273bf33312787d0791798994be01331a1c0a0 3532150 wordpress_4.4+dfsg-1_all.deb
Checksums-Sha256:
 b56a7d4234dd37dfaa5be043488f53d06ffd0465241a077b9c5c7f42829983ec 2503 
wordpress_4.4+dfsg-1.dsc
 b825f86b1382c745137d591964d685b2bdb4aee7c71b243ae98b977b1ee8eab9 5445596 
wordpress_4.4+dfsg.orig.tar.xz
 194f4093a71bbc94c520e71851afe5b2d2bd6e0b0d4d3bbeb2346ed4aabb5011 6054688 
wordpress_4.4+dfsg-1.debian.tar.xz
 faebef349a5718e480eb2f8f122d0f42629b0422a8b99ae10d37533132f32c41 4362094 
wordpress-l10n_4.4+dfsg-1_all.deb
 6c8cdbb4c7ddd66e5d5b37093877f823f7d59461b08f5a3dba3797adc93cdc26 502474 
wordpress-theme-twentyfifteen_4.4+dfsg-1_all.deb
 ea9723a4ee5426347fa0aa4262a82185b6b80996aee9e792072d82082bb5fc44 803818 
wordpress-theme-twentyfourteen_4.4+dfsg-1_all.deb
 9c8189846c7022f661d5a26398867758fab40c6ebaacc217859358d20df0617b 587510 
wordpress-theme-twentysixteen_4.4+dfsg-1_all.deb
 f8127f84c5f0f5ff6da5287a4481d8be347f495ae57d50d50f1d629c1e0a9722 3532150 
wordpress_4.4+dfsg-1_all.deb
Files:
 07afec200e8ad3449fc4bc7a5c2cae56 2503 web optional wordpress_4.4+dfsg-1.dsc
 efb63b955d4a5134956ae9be1d369e02 5445596 web optional 
wordpress_4.4+dfsg.orig.tar.xz
 dff47d0fc32a0215059feebfecd80ea5 6054688 web optional 
wordpress_4.4+dfsg-1.debian.tar.xz
 09974f71ffe032737dce1043312baaf9 4362094 localization optional 
wordpress-l10n_4.4+dfsg-1_all.deb
 3b4a50c8ab12a9c8c489effe0aeb140b 502474 web optional 
wordpress-theme-twentyfifteen_4.4+dfsg-1_all.deb
 044df329d6533618bff1b31f73743f30 803818 web optional 
wordpress-theme-twentyfourteen_4.4+dfsg-1_all.deb
 11c31c23a5632ad38fbbadbf331ea05e 587510 web optional 
wordpress-theme-twentysixteen_4.4+dfsg-1_all.deb
 5d2b1a41156422626bff751e77641886 3532150 web optional 
wordpress_4.4+dfsg-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJWaqgEAAoJEAIhZsD/PITjg50P/jYO5c/NB/6nGgdOrGCSzeWX
8UNpUvcW4H72FC1vy6Xn+kcnaXNYiC60e2WjDoKxt3GlQuRxrUlSQXWOoun/opH8
TTdds1QqGyJ99Jf+SJOyPygoX/JhvadP36PjxaPZP4SnVn1cC1rnBbMP1vRfZCnV
gkfAPsGh8riArZYy7AheUDz1aVhf0cdi81JaiZZpnumr00qATD5KBCKPwjgPJxLI
lC9qFe3lxe9cCLpnIwNK8DN3Ofz22MwB0bpcFNWpmY6V+e1niS71LAfdICeI6UZg
GwpR7Oo7dZ2xIW6d3LJjVge55sK+0HmaY4M1ZmEFRHtd72QxX7DsyZGDTrqONh0y
Wk7Hm1FhUkMYb74wfDWBJwXozuol310WDIuko6ASqWNoDvkomctNsJiiLCJUDblE
PLbV9u5xJxfPY4wRI2jqJBKP9kly288uHKYrJDmdXCIUCwXWjBhCSZ0osUr0c/NB
p4TeGb0VwhdcxBF3/Az5m/3TGre7kfs3LZq4mF5wx3UOlX7JFAvxRrh5JqJLsUy9
DbdswtxjRZl4v6A0047uBdk2nejKH3l7v5Oh1PVNqLRAyTH1syYACvTCb1xEu/al
f1juf+sr2FmpjYzvUbhXA1n2pTWbcjx7kdMYqlZLdmYG4aEO0f6n9VeRT5F03vYk
bIk5yrImRO6LEGXf9mH5
=FTVx
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to