Nirvana "import settings" don't work with FTP method

  • Author
    Posts
  • #36412
    Charles Hall

    When WordPress decides to use FTP as the file transport method, the “Import Settings” button does not have any effect. It prompts for credentials, then does nothing.

    I have checked this on both Unix and Windows multisite installs with the same results.

    You can try it yourself by forcing WordPress to use FTP like this in the wp-config.php:

    define(‘FS_METHOD’,’ftpsockets’);

    Normally WP guesses what to use, but by turning this on I can replicate the Unix system behavior on my PC. On neither platform does the FTP server ever get a request.

    I have spent some hours trying to follow the code, but it’s beyond me.

    Can someone help?

    Charles Hall
    Cary, NC
    USA

    #36417
    Charles Hall

    Hah! Well here’s a fix. I don’t know why but the code is trying to write out a file called “nirvanas.txt” to the blog’s upload directory. But it then proceeds to load it into the database. Why not just upload the originally uploaded file from it’s temporary location and skip writing out that intermediate file?

    So just comment out all the lines in admin-functions.php nirvana_import_file() function having to do with credentials: 138-140, 142, 144-146, 149, 150, 153-157. And change line 162 from this:

    $data = $wp_filesystem->get_contents($filename);

    to this:

    $data = file_get_contents($_FILES[‘import’][‘tmp_name’]);

    and it works!

    #36467
    Zed
    Cryout Creations mastermind

    Repository themes have to use WordPress functionality such as $wp_filesystem to perform actions like reading files instead of direct manipulation.

    We’ll look into adding support for FTP upload (instead of direct access) in the import procedure.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Nirvana "import settings" don't work with FTP method’ is closed to new replies.