Skip to content

Custom attribute added through $eavSetup->addAttribute not setting frontend_class #3439

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

Closed
OLTC-fperrin opened this issue Feb 17, 2016 · 1 comment
Assignees

Comments

@OLTC-fperrin
Copy link

I tried to set some validation classes for a custom attribute but the frontend_class doesn't seem to get filled in:

$eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'duration',
                [
                    'type' => 'decimal',
                    'label' => 'Duration',
                    'input' => 'text',
                    'class' => 'validate-greater-than-zero',
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                    'visible' => true,
                    'required' => true,
                    'user_defined' => true,
                    'default' => '1',
                    'searchable' => false,
                    'filterable' => false,
                    'comparable' => false,
                    'visible_on_front' => true,
                    'unique' => false,
                    'used_in_product_listing' => false
                ]
            );

This was inspired by the content of magento/module-catalog/Setup/CategorySetup.php
I tried using class and frontend_class without success
Am I missing something or is it a glitch ? thanks

@maksek
Copy link
Contributor

maksek commented May 9, 2016

Hi @LTC-fperrin, please ask questions on forums. GitHub only for bugs with steps to reproduce.

@maksek maksek closed this as completed May 9, 2016
magento-engcom-team pushed a commit that referenced this issue Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants