My examples are geared towards category image attribute, but the principle is the same for product based.
This information should get you going in the right direction (I hope)
Attributes have two elements that define their input and backend (processing) behaviour.
Below is the base requirements for a new attribute created in a category, which is an image. (the snippet is taken from a co-workers megamenu module (with some help from me in some areas, of course ;), and I include the ref to the code to allow you to view the snippet in context, which may clarify the code - [https://github.com/benjy14/MegaMenu/blob/master/app/code/local/DevBlog/MegaMenu/Model/Mysql4/Setup.php)
'megamenu_feature_image' => array(
'type' => 'varchar',
'label' => 'Menu Feature Image',
'note' => 'Make sure the width is 260px',
'input' => 'image',
'backend' => 'catalog/category_attribute_backend_image',
'required' => false,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'visible_on_front' => true,
'used_in_product_listing' => false,
'is_html_allowed_on_front' => false,
),
The important bits (for you) will be the input
and backend
elements.
'input' => 'image'
relates to : Varien_Data_Form_Element_Image
(all the input element renderers live in lib/varien/data/form/element
'backend' =>
'catalog/category_attribute_backend_image', => relates to (well as it says) Mage_Catalog_Model_Category_Attribute_Backend_Image
:)
in Mage_Catalog_Model_Category_Attribute_Backend_Image
you will see a method 'afterSave' where processing takes place after the image is uploaded.
for a custom input renderer, you will rather use 'input_renderer' (ref: http://inchoo.net/ecommerce/magento/adding-magento-attribute-with-custom-input-renderer/ I am not sure if 'input' will work for a custom renderer, but worth a try. (magento do change at times)
Thus, you just need to point the attribute to your custom input and backend models.
Hope this helps.
The attribute is created by Mage_Catalog_Model_Resource_Setup, therefore you should be able to recreate it:
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'manufacturer', array(
'type' => 'int',
'label' => 'Manufacturer',
'input' => 'select',
'required' => false,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_in_advanced_search' => true,
'apply_to' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
)
);
Throw this code snippet into one of your install scripts and this should do the job
Code is copied from here app/code/core/Mage/Catalog/Model/Resource/Setup.php:491
Best Answer
This was almost certainly changed in 1.6 part of adding Oracle support - in Oracle, columns can only be 30 characters long, so lots of Magento attributes got shortened, and I imagine this restriction was added at the same time.
See http://m-chanaan.hr/wp-content/uploads/2013/04/RDBMS_Guide2.pdf for a lot of discussion on this.