Support » Plugin: File Away » Migration broke File Away

  • Resolved escap0

    (@escap0)


    Hi Thom,

    I recently migrated from Hostgator to Flywheel.

    I am using Alkaweb’s Woffice intranet theme.

    File Away stopped working after the migration. Shortcodes dont show anything. Can’t create new directories. Nothing seems to work. I do have full access to plugin settings and saving something does appear to save.

    WP debug shows these two lines over and over when I try to access a File Away functionality:

    [30-Sep-2019 19:39:44 UTC] PHP Warning: mkdir(): Permission denied in /www/wp-content/plugins/file-away/lib/cls/class.fileaway.php on line 28
    [30-Sep-2019 19:39:44 UTC] PHP Warning: mkdir(): Permission denied in /www/wp-content/plugins/file-away/lib/cls/class.fileup.php on line 35

    Any idea what is going on or how to fix this?

    Thank you so much for your assistance.

    Kindly – Omer

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author thomstark

    (@thomstark)

    Flywheel has a very different setup with their WP sites than any other host. Here is a fix for now:

    Open up wp-content/plugins/file-away/lib/cls/class.fileaway_definitions.php

    insert this line at line 137:

    $ABSPATH = '/www/';

    That creates a variable called $ABSPATH and hard codes it to your actual document root there on Flywheel.

    Then change every instance of ABSPATH (which is WordPress’s constant for your wp install directory) to $ABSPATH (which is our custom variable) on the subsequent two lines:

    
    $installpath = str_replace('\\','/',$ABSPATH);
    $rootpath = str_replace('\\','/',($install ? substr_replace($ABSPATH, '', strrpos($ABSPATH, $install), strlen($install)) : $ABSPATH));
    

    Save and you should be good.

    Also don’t forget to go to your File Away settings page and hit Save Settings just as an added measure in case your url changed somehow. Even if the URL is correct, hit save settings anyway. Always recommended after a migration.

    • This reply was modified 3 months, 2 weeks ago by thomstark.
    • This reply was modified 3 months, 2 weeks ago by thomstark.
    • This reply was modified 3 months, 2 weeks ago by thomstark.

    Thom, Thank you so much! It appears to have worked!

    Is there a reason that we don’t add a $ to ABSPATH on the subsequent line that immediately follows the two lines above you had me change?

    $chosenpath = str_replace('\\','/',($this->options['rootdirectory'] === 'siteurl' ? $rootpath : ABSPATH));

    Thanks again, your help is very much appreciated.

    Kindly – Omer

    Upon further testing, I am unable to get the uploading feature to work.

    I get this message below the displayed Flywheel Directory (on the page where the upload shortcode is):

    —————
    File Up Admin Notice: The initial directory specified does not exist:
    /wordpress/wp-content/uploads/executive-files
    —————

    That does exist. I can see it when viewing the Directory via File Away on the same page.

    The directory view does work. No problems creating a directory or deleting it (results reflected when checking via FTP).

    Any ideas on what it could be?

    Thank you for your assistance.

    Kindly – Omer B

    Hah! I went ahead and changed the 3rd subsequent line ABSPATH to $ABSPATH:

    from:
    $chosenpath = str_replace('\\','/',($this->options['rootdirectory'] === 'siteurl' ? $rootpath : ABSPATH));

    to:
    $chosenpath = str_replace('\\','/',($this->options['rootdirectory'] === 'siteurl' ? $rootpath : $ABSPATH));

    And it worked!

    Thank you so much. Donated to your daughter’s food fund!

    Kindly – Omer B

    Also had the same issue and it resolved after following escap0’s augmented instructions. Thanks to all for the assistance. I hope this is able to be fixed for future versions of the plugin so it doesn’t break again every time it’s updated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.