While this isn't the most elegant solution, I have managed to make a work-around for my environment that solves this issue and a related one of not being able to create export .csv files. Basically I commented out any of the plugins attempts to create sub-folders to the /wp-content/uploads/gravity_forms folder and let it do all the file creation within that folder.
To do so, I made the following changes in /wp-content/gravityforms/forms_model.php that start at around line 1075 in version 1.3.10.
public static function get_upload_path($form_id){
//return self::get_upload_root() . $form_id;
return self::get_upload_root();
}
public static function get_upload_url($form_id){
$dir = wp_upload_dir();
//return $dir["baseurl"] . "/gravity_forms/$form_id";
return $dir["baseurl"] . "/gravity_forms/";
}
The last one is a little longer function so more written instruction than copy/paste
Find public static function get_file_upload_path($form_id, $file_name) {
Comment / replace the $target_root and $target_rool_url lines below:
//$target_root = self::get_upload_path($form_id) . "/$y/$m/";
$target_root = self::get_upload_path($form_id);
//$target_root_url = self::get_upload_url($form_id) . "/$y/$m/";
$target_root_url = self::get_upload_url($form_id);
Comment out the attempted directory creation directly below
//if(!wp_mkdir_p($target_root))
//return false;
I still can't answer WHY my environment won't allow those folders to be created even though it appears everything has proper permissions to do so, which sucks from an ongoing upgrade perspective. But this does work for the time being.
Does this help with a potential fix for it?
Posted 14 years ago on Tuesday March 9, 2010 |
Permalink