I think it is much more basic than directory names and permissions.
From the Attributes controller, when using the Insert to add a new attribute, all the information writes to the database expect the attribute image name.
When I modify attributes_controller.php (in Admin) to remove the IF statements and get down to just the 2 lines that set the variable.
And then remove the attributes_image input and hardcode some text for the image file name.
Then the attributes_image field is written to in the database - and is what I would expect "attributes/filename.jpg".
Around line 227
Code:
// if (isset($_POST['attributes_image']) && zen_not_null($_POST['attributes_image']) && ($_POST['attributes_image'] != 'none')) {
$attributes_image = "filename.jpg"; //zen_db_prepare_input($_POST['attributes_image']);
// } else {
// $attributes_image = '';
// }
// $attributes_image = new upload('attributes_image');
// $attributes_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
// if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) {
$attributes_image_name = $_POST['img_dir'] . $attributes_image ->filename;
// } else {
// $attributes_image_name = (isset($_POST['attributes_previous_image']) ? $_POST['attributes_previous_image'] : '');
// }
I change one line from
Code:
$attributes_image = "filename.jpg"; //zen_db_prepare_input($_POST['attributes_image']);
TO:
Code:
$attributes_image zen_db_prepare_input($_POST['attributes_image']);
And the Attributes Image Swatch input in Admin Attribute Control no longer is inserted into the attributes_image filed.
What is in the field: "attributes/"
What is expected: "attributes/filename.jpg"
By the way, tried "Updating" versus "Inserting". The attributes_image field still does not change.
Working down through the commented sections of code. Nothing changes until I uncomment the last if statement:
Code:
if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) {
$attributes_image_name = $_POST['img_dir'] . $attributes_image->filename;
} else {
$attributes_image_name = (isset($_POST['attributes_previous_image']) ? $_POST['attributes_previous_image'] : '');
}
With this code uncommented, nothing is written to the attributes_image field of the database. I had "overwrite" = NO
I think I am at my limit of figuring out the code. Any other ideas?