Skip to content
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

Add multibyte support for attributeSource getOptionId method #22033

Merged
merged 4 commits into from
Apr 23, 2019

Conversation

gomencal
Copy link
Contributor

@gomencal gomencal commented Mar 29, 2019

Add multibyte support for attributeSource getOptionId method

Description (*)

Currently, if a option value has special characters in UTF-8 (for instance), the use of strcasecmp PHP function causes incorrect matching, because it doesn't support multibyte strings.

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Create an option value with special characters ("Sí" for instance)
  2. In a script try to load it as:
    $value = 'Sí'; $attribute = $this->resource->getAttribute($attributeCode); $optionId = $attribute->getSource()->getOptionId($value);
    It must find the option value and return its Id.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Mar 29, 2019

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team magento-engcom-team added Component: Eav Release Line: 2.3 Partner: Interactiv4 Pull Request is created by partner Interactiv4 partners-contribution Pull Request is created by Magento Partner labels Mar 29, 2019
* @param null|string $encoding
* @return int|\\lt
*/
private function mbStrcasecmp($str1, $str2, $encoding = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
why do you add an optional parameter if it's never used? Or am I missing something?
Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gomenca, do you have any update on this? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aleron75 , you are right. I've just used this function in another places and used this parameter. I drop it.

@ghost ghost assigned aleron75 Apr 2, 2019
@magento-engcom-team
Copy link
Contributor

Hi @aleron75, thank you for the review.
ENGCOM-4735 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@gomencal thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Apr 23, 2019

Hi @gomencal, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: bug fix Component: Eav Partner: Interactiv4 Pull Request is created by partner Interactiv4 partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants