Use of Non-Writable Paths - by PremiumPetware

This topic has 6 replies, 2 voices, and was last updated 6 years, 7 months ago ago by Rose Tyler

  • Avatar: PremiumPetware
    PremiumPetware
    Participant
    April 15, 2018 at 11:49

    I have struck an issue with 4.2.1 (from 3.3) where I am unable to save changes to the theme as it requires write access to a non writable directory.

    I use Pantheon which has Dev / Test / Live structure

    The theme saves to /wp-content/themes/woopress/dynamic.css which is not writable in the test / live environments.

    Pantheon state :

    “WordPress stores files within wp-content/uploads and Drupal uses /sites/default/files. These directories are symbolically linked to Pantheon’s cloud-based filesystem, Valhalla, which is writable on all environments. Extensions that create files within the codebase (e.g. wp-content/plugins/plugin-name/some-other-directory or /sites/all/modules/module-name/some-other-directory) incorrectly assume write access”

    Why does this theme not follow this protocol (is it a protocol?) and is it likely to change?

    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 16, 2018 at 10:01

    Hello,

    Please create an empty dynamic.css file in woopress-child theme folder and set permissions 777 for the file + add wp_enqueue_style( 'dynamic-css', get_stylesheet_directory_uri() . '/dynamic.css' ); in woopress-child/functions.php file. Then go to Theme Options and re-save them.
    If the problem won’t be solved, provide us with temporary wp-admin and FTP access in the Private Content area.

    Regards

    Avatar: PremiumPetware
    PremiumPetware
    Participant
    April 16, 2018 at 21:55

    Thank you Rose.

    I have created the empty dynamic.css in woopress-child theme folder (under plugins) and updated the functions.php as below;

    <?php add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘bootstrap’, ‘parent-style’ ) );
    wp_enqueue_style( 'dynamic-css', get_stylesheet_directory_uri() . '/dynamic.css' );
    }

    After pushing to test, I still get the error

    Unable to write to file /srv/bindings/big_long_code_here/code/wp-content/themes/woopress/dynamic.css

    Have I edited the functions.php file incorrectly?

    Avatar: PremiumPetware
    PremiumPetware
    Participant
    April 17, 2018 at 00:19

    Pantheon say that I have to move the dynamic.css file to uploads and create a symlink in the woopress folder. Uploads (symlink to files) is the only writable section in Test and Live environments.

    Avatar: PremiumPetware
    PremiumPetware
    Participant
    April 18, 2018 at 13:19

    I have managed to fix this by moving dynamic.css to wp-content/uploads and creating a symlink for dynamic.css in the woopress dir.

    I was having issues because it turns out that the windows GIT bash tool can not create symlinks using usual commands (despite selecting the option to create symlinks during GIT app install) and I had to create a linux vm to run the commands to create the symlink in the cloned git repository and push it back up.

    I reverted the changes made to functions.php beforehand.

    Cheers.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 18, 2018 at 13:34

    Hello,

    I am glad that you sorted out.
    Feel free to ask if you have any other questions.

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.