The MU forums have moved to WordPress.org

Incompatible Archive Theme Install Failed in class-wp-upgrader.php (6 posts)

  1. frankindelicato
    Member
    Posted 14 years ago #

    Downloading any theme gives me this error:
    Unpacking the package.
    Installing the theme.
    Incompatible Archive
    Theme Install Failed.

    I am new to wordpress/wordpress-mu but I was able to track the problem this far:
    In class-wp-upgrader.php. The following warning is displayed:
    [11-Feb-2010 07:17:30] PHP Warning: array_keys() expects parameter 1 to be array, boolean given in /Users/frankindelicato/Sites/wordpressmu/wp-admin/includes/class-wp-upgrader.php on line 194
    Dumping some of the variables in this section of code I think that the failure is because the $source variable is pointing to a temporary directory that contains the actual directory of the theme. There is a call that I believe sets up these directories:
    $res = apply_filters('upgrader_pre_install', true, $hook_extra); but I cannot find any documentation on this filter or on $wp_filesystem which seems to be doing all the grunt work. I think the issue may be in class-pclzip.php where the temporary directory is created. Any help would be great!!!

  2. frankindelicato
    Member
    Posted 14 years ago #

    Well, after a couple of days of study and learning a great deal about the Wordpress code I finally tracked the problem down to the PHP @ftp_rawlist call in the function 'dirlist()in the class file 'class-wp-filesystem-ftpext.php. The @ftp_rawlist call preforms an ftp LIST command and returns a listing of a directories contents, including any folders in the directory. This actual call was: $list = @ftp_rawlist($this->link, '-a ' . $path, false); where $this->link is the connection resource Id, and the -a is asking to "Include directory entries whose names begin with a dot (.)." The $path variable is the path to the directory, and the false indicates no recursion. It was returning a boolean false instead of an array of file/folder listings.
    By removing the @ and the -a the code works perfectly. The new call should now read: $list = ftp_rawlist($this->link, $path, false);. Apparently, this is a notorious function call as indicated by all the complaints found on google. Anyway, if anyone else is having this same problem I hope this will help.
    Oh, the configuration I am running is a Macbook Pro with a stand-alone Wordpress testing blog using MAMP and Wordpress-mu running under the Apple Apache/PHP engines. Both systems showed the problem...

  3. andrea_r
    Moderator
    Posted 14 years ago #

    File a trac ticket please. :)

    http://core.trac.wordpress.org/

  4. frankindelicato
    Member
    Posted 14 years ago #

    OK, I will file my first ticket. I searched the trac and found another reference to ftp_rawlist. On that ticket there is a mention by dd32 of the error control operator at sign @. He stated: "not sure of the need for @ there, but might as well leave it in, it'll make minimal performance difference. (I cant remember why rawlist needed it, I think it was outputting Success messages as warnings)"
    So I tested again and found that the @ sign was not the problem but the problem was actually the -a portion in the ftp_rawlist function. When it is removed the ftp_rawlist function works fine. It was not needed anyway because the code snippet that follows ignores the . and .. directories anyway; in the line of code if ( '.' == $entry['name'] || '..' == $entry['name'] )continue; below:

    //	        $list = ftp_rawlist($this->link, '-a ' . $path, false);
    		$list = @ftp_rawlist($this->link,$path);
    if (defined('FJI'))err_msg('$php_errormsg=',$php_errormsg);
    if (defined('FJI'))if(empty($list))err_msg('WP_Filesystem_FTPext $list=empty');
                    if ( $list === false )return false;
    		$dirlist = array();
    		foreach ( $list as $k => $v )
    		{
    			$entry = $this->parselisting($v);
    			if ( empty($entry) )continue;
    			if ( '.' == $entry['name'] || '..' == $entry['name'] )continue;
    			if ( ! $include_hidden && '.' == $entry['name'][0] )continue;
    			if ( $limit_file && $entry['name'] != $limit_file)continue;
    			$dirlist[ $entry['name'] ] = $entry;
    		}

    Also, when the error control operator '@' is used when the '-a' is put back in there are no error messages returned, so that is a little confusing. I have never filed a ticket before so I am not sure what to do. I will read up on filing tickets etcetera. I guess I will try to link the old #10060 ticket to the new one I file and title it something like "ftp_rawlist using -a option" or something like that? Sorry for being so verbose...

  5. andrea_r
    Moderator
    Posted 14 years ago #

    Open a new ticket since it's a slightly different issue. Use the login link there on the upper right, and login with the same username/password that you have here on the forum. When logged in there will be a "new ticket" link. Give as much detail as possible, and link to this thread and that other ticket. make sure in the version you tell them it's in MU.

  6. frankindelicato
    Member
    Posted 14 years ago #

    OK. Ticket #12232 has been submitted.

About this Topic

  • Started 14 years ago by frankindelicato
  • Latest reply from frankindelicato