-
-
Notifications
You must be signed in to change notification settings - Fork 450
Fix file delete of customer attribute #927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…penMage#594 Remove whitespace in addBodyClass($className)OpenMage#594
|
Hi |
|
[edited] To reproduce in the ver 1.9.4.x
The reason it doesn't delete is because Step 1, add attribute INSERT INTO `eav_attribute` (`attribute_id`, `entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`)
VALUES (NULL, '1', 'some_csv', NULL, NULL, 'varchar', NULL, NULL, 'file', 'Some CSV File', NULL, NULL, '0', '1', NULL, '0', 'Accept CSV only');
# Note the attribute_id from above
INSERT INTO `customer_eav_attribute` (`attribute_id`, `is_visible`, `input_filter`, `multiline_count`, `validate_rules`, `is_system`, `sort_order`, `data_model`)
VALUES ({{attribute_id}}, '1', NULL, '1', 'a:1:{s:13:\"max_file_size\";i:2000000;}', '0', '4', 'customer/attribute_data_file')
INSERT INTO `customer_form_attribute` (`form_code`, `attribute_id`)
VALUES ('adminhtml_customer', {{attribute_id}})Step 2, render the attribute in backend's customer page: // copy paste the following code in line 279 app\code\core\Mage\Adminhtml\Block\Customer\Edit\Tab\Account.php
$fieldset->addField('some_csv', 'file',
array(
'name' => 'some_csv',
'label' => 'Some CSV File'
)
); |
| } | ||
| return true; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To trace the logic, please expand to code below to show the function compactValue, where the delete operation is carried out.
Unit Test Results1 files 1 suites 0s ⏱️ Results for commit 7a039a6. |
* Insert whitespace in class name for styling to work. See pull request OpenMage#594 Remove whitespace in addBodyClass($className)OpenMage#594 * Fix file delete in customer attribute of `frontend_input` = 'file'.
[edit] This bug affects file deletion of cusotmer attribute in both frontend and backend. It was introduced in ver 1.9.4.1:
in the class
Mage_Eav_Model_Attribute_Data_File.