-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Validation change for Text type EAV attributes #62
Conversation
The call on Mage_Eav_Model_Attribute_Data_Text:67 to empty returns true of a value of "0" is entered, as specified in the PHP spec. This prevents the entry of zero on the backend admin for fields. Zero should be a valid value, as it was in our case. No unit tests were created, as no unit tests exist currently for the Eav module.
Ignore my comment about Unit tests. I hadn't synced my fork in a while. I am so absent minded. Working on a unit test right now. |
Sorry for not including this originally.
why do you close your pull request tim? |
I opened a new one. Github didn't give me the option to amend my pull request. Sent from my iPhone On Aug 17, 2012, at 6:47 PM, "Sebastian" <notifications@github.commailto:notifications@github.com> wrote: why do you close your pull request tim? — |
MAGETWO-44707: Remove @api sign from CatalogInventory module
JS-338: [Configurable.JS] Do not reload full image set when "First by First" is enabled
…e-cm-cache-backend-file [Extensibility] Bug fixes
Merge 2.3-develop to EPAM-PR-2
The call on Mage_Eav_Model_Attribute_Data_Text:67 to empty returns true of a value of "0" is entered, as specified in the PHP spec. This prevents the entry of zero on the backend admin for fields. Zero should be a valid value, as it was in our case.
No unit tests were created, as no unit tests exist currently for the Eav module.
I originally changed the code to the more complex:
if ($attribute->getIsRequired() &&
(
(is_array($value) && empty($value)) ||
(is_string($value) && strlen(trim($value))==0)
)
However, I wasn't sure that would catch all cases. I was also unsure if an array or numeric value would ever pass into the validator. I felt the cast-less comparison against the primary issue input was the best solution.