Roots Discourse

Allow file mods for languages

trellis

#1

Hi,

I’m currently available to upload files to the web/app/uploads directory (as default).
I have web/app/languages symlinked, exactly like uploads dir.

But I run Loco Translate with my WP setup and I want to be able to edit those files and override the define(DISALLOW_FILE_MODS, TRUE); setting.

How do I grant permissions to other directories like /languages?

Thanks!

/Jonas


#2

You can set permissions in the same spot:


#3

Thanks!

But if default is 755 and ‘directory’ my config should work.

project_shared_children:
  - path: web/app/languages
    src: languages
    mode: '0755' // tried to add this
  - path: web/app/uploads
    src: uploads

But it does not after I ran
vagrant provison


#4

Found this after hours of google-threads.

add_filter( 'file_mod_allowed', 'allow_file_mod_language_folder', 10, 2 );
function allow_file_mod_language_folder( $allow_file_mod, $context ) {
  if ( 'download_language_pack' === $context ) {
    return true;
  } else {
    return $allow_file_mod;
  }
}

Which allows Loco Translate to edit my files. Still need the trellis settings to not override languages on deploys.