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

Multiline field is broken #18115

Closed
escopecz opened this issue Sep 18, 2018 · 15 comments
Closed

Multiline field is broken #18115

escopecz opened this issue Sep 18, 2018 · 15 comments
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@escopecz
Copy link

Preconditions

Magento 2.2.4
API authorization OAuth1a

Steps to reproduce

  1. Create new multiline custom field on the customer object.
  2. Fill in some values for a customer like this:
    screen shot 2018-09-18 at 13 56 38
  3. Save the customer.
  4. Open the edit form for that customer again. All the values are gone like this:
    screen shot 2018-09-18 at 13 57 18
  5. Let's see what the API will return us for that field:
  "custom_attributes": [
    {
      "attribute_code": "multiline",
      "value": "aaa"
    }
  ]

Hmm, that is interesting... It's the value of the first field as a string. So multiline fields will return string as a value? Wait, the Street field is also type of multiline. What that field returns in the API?

    "street": [
        "Address 11s5"
      ],

So this multi line field can return a string and/or an array? You know what's interesting too? The street field require an array when you want to save a value to that field via API. But another multiline field requires a string. What is the pattern here?

Expected result

  1. Multiline field will store the values when the customer is saved.
  2. Multiline field will return and expect consistent value type via API.

Actual result

  1. Multiline field does not store the values when the customer is saved.
  2. Multiline field does not return and expect consistent value type via API.
@magento-engcom-team
Copy link
Contributor

Hi @escopecz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@escopecz do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 18, 2018
@ghost ghost self-assigned this Sep 18, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 18, 2018

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label G1 Passed will be added to the issue automatically. Please, edit issue description if needed, until label G1 Passed appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add G2 Passed label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label acknowledged once verification is complete.

  • 7. Make sure that automatic system confirms that report is acknowledged.

@ghost ghost added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 18, 2018
@ghost
Copy link

ghost commented Sep 18, 2018

Hi @escopecz, thank you for your report. Customer attribute available only on EE version. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

@ghost ghost closed this as completed Sep 18, 2018
@ghost
Copy link

ghost commented Sep 18, 2018

@escopecz also duplicate for this -> #8086

@escopecz
Copy link
Author

I saw that ticket. I find my ticket more descriptive and actually all I care about is the API problem that it returns/expects sometimes array and sometimes string. This is not mentioned at the other ticket at all. Please reopen.

@ghost
Copy link

ghost commented Sep 18, 2018

@escopecz No, problem described in referenced ticked actually the same, custom attribute not save correctly, so in the API you have the same result, if someone fixed referenced ticket, you resolve you issue.
And referenced issue already have created ticket, and someone maybe work for this

@escopecz
Copy link
Author

How come the street multiline field works and other don't? I have to implement the API communication for this field and it's nightmare as I don't know what the rule for the field value type is. I'd remove this type from field mapping completely as it's buggy, but the street field is important.

@ghost
Copy link

ghost commented Sep 18, 2018

@escopecz
Street Address use another logic of attributes and this works for magento core, but for custom attributes not.
As i can see this bug is acknowledged, and we are waiting for maintainer to fix this.
Also you can use multiselect attribute.

@escopecz
Copy link
Author

Thanks a lot for explanation! That's what I needed. So I'll ignore all multiline fields that are not system.

@amenk
Copy link
Contributor

amenk commented Jan 18, 2019

Did anybody here already work on making Magento allowing to change a field type (company in our case) to multiline and make it work across the frontend and API? We are wondering if it is better to implement this in the core and provide a pull request or make a own custom module.

Any feedback is appreciated.

Sorry for the forum-like post

@vivekkumarcedcoss
Copy link
Contributor

@amenk & @escopecz you can review the PR #20371 , this issue was fixed in that PR.

@amenk
Copy link
Contributor

amenk commented Jan 23, 2019

@vivekkumarcedcoss but that is only for Admin Config inputs, right?

@vivekkumarcedcoss
Copy link
Contributor

Yes @amenk that PR is only for Configuration.

@magento-engcom-team
Copy link
Contributor

Hi @escopecz. Thank you for your report.
The issue has been fixed in #20371 by @vivekkumarcedcoss in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 24, 2019
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Mar 30, 2019
@magento-engcom-team
Copy link
Contributor

Hi @escopecz. Thank you for your report.
The issue has been fixed in #21561 by @vivekkumarcedcoss in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

4 participants