Validation change for Text type EAV attributes#62
Closed
tim-reynolds wants to merge 4 commits into
Closed
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.
Contributor
Author
|
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? |
Contributor
Author
|
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.1485827954.workers.devmailto:notifications@github.com> wrote: why do you close your pull request tim? — |
Closed
Closed
okorshenko
pushed a commit
that referenced
this pull request
Oct 28, 2015
MAGETWO-44707: Remove @api sign from CatalogInventory module
This was referenced Nov 22, 2015
magento-team
pushed a commit
that referenced
this pull request
Mar 23, 2016
JS-338: [Configurable.JS] Do not reload full image set when "First by First" is enabled
okorshenko
pushed a commit
that referenced
this pull request
Jun 12, 2016
…e-cm-cache-backend-file [Extensibility] Bug fixes
magento-engcom-team
pushed a commit
that referenced
this pull request
Aug 27, 2018
Merge 2.3-develop to EPAM-PR-2
5 tasks
1 task
5 tasks
5 tasks
5 tasks
5 tasks
5 tasks
5 tasks
magento-devops-reposync-svc
pushed a commit
that referenced
this pull request
Feb 5, 2026
Fixed fatal error where AbstractAdapter mock was missing abstract methods. Issue: Class MockObject_AbstractAdapter contains 2 abstract methods Solution: Added abstract methods to onlyMethods() array Changed: ->onlyMethods([]) To: ->onlyMethods(['translate', '__']) This properly mocks the abstract methods while allowing non-abstract methods like isTranslated(), setLocale(), and toString() to use their real implementations. Commit #62 - Fixed AbstractAdapter fatal error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.