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

shipperhq_shipping_group attribute issue on save #30

Closed
yuriyrudyuk opened this issue Aug 14, 2017 · 6 comments
Closed

shipperhq_shipping_group attribute issue on save #30

yuriyrudyuk opened this issue Aug 14, 2017 · 6 comments
Assignees

Comments

@yuriyrudyuk
Copy link

yuriyrudyuk commented Aug 14, 2017

Hello,

We've noticed an issue with shipperhq_shipping_group product's attribute.
When trying to re-save it (in our case new options were added) from admin (Stores -> Attributes -> Product) it changes its configuration
From:
backend_type -> text
attribute_model -> null
source_model -> null
To:
backend_type -> varchar
attribute_model -> Magento\Catalog\Model\ResourceModel\Eav\Attribute
source_model -> Magento\Eav\Model\Entity\Attribute\Source\Table

As the result, shipperhq group can't be updated for existing products (which uses "text" backend type).

Magento version - EE 2.1.4

Thanks

@birchestx birchestx self-assigned this Aug 22, 2017
@birchestx
Copy link

You shouldnt be manipulating this field in the magento admin, its synchronised automatically with ShipperHQ via the extension and is connected to the data from the ShipperHQ server. If you are re-saving it we couldnt be certain at all how Magento would handle it.

If you look at https://github.com/shipperhq/module-shipper/blob/master/src/Setup/InstallData.php it shows how this attribute should be setup.

source_model -> Magento\Eav\Model\Entity\Attribute\Source\Table
backend_type -> text
attribute_model -> Magento\Catalog\Model\ResourceModel\Eav\Attribute

This is what you need to get it back to. If you are struggling to do this let us know and we can assist over email. Closing issue.

@hostep
Copy link

hostep commented Oct 28, 2019

Hi @wsakaren!

Is there some way for you guys to prevent shop owners from saving these special product attributes?
We have a client who keeps trying to save them causing to change the type of the attribute and this then breaks stuff.
We already told them twice to keep away from those attributes, but they aren't really listening ... 😛

In our case, it's these attributes:

  • ship_length, changes from decimal to varchar
  • ship_width, changes from decimal to varchar
  • ship_height, changes from decimal to varchar
  • shipperhq_poss_boxes, changes from text to varchar

If it wouldn't be possible to save those attributes from the Magento backend, it would prevent this from happening and that would be a nice addition to your extension.

Thanks!

@wsajosh
Copy link
Contributor

wsajosh commented Oct 29, 2019

Hey @hostep

Unfortunately that's outside the control of our module. They're just regular Magento attributes.

If you do find a way, it would be great if you can submit a PR and we will merge it into the main code base.

@hostep
Copy link

hostep commented Oct 29, 2019

Thanks @wsajosh

Hmm, I'm wondering though why the backend_type of these attributes change the moment you save them in the backend of Magento (even without changing anything), that's a bit weird no? That's not normal behavior of regular Magento attributes I believe?
Unfortunately I haven't found time to dig into this yet, and not sure if I will find time in the near future.

@wsajosh
Copy link
Contributor

wsajosh commented Nov 1, 2019

Hey @hostep

It's a very weird scenario and not one that we're able to reproduce on our own local installs, but have seen it on a handful of customer sites. It usually affects a lot of attributes rather than just our ones also which is another reason we've not dug into this deeply. It appears to be a Magento issue, there's various articles on stack overflow or similar sites with the same issue.

@hostep
Copy link

hostep commented Nov 1, 2019

Thanks for the comment @wsajosh.
Ah, I wasn't aware of the fact that it is not easily reproducible.
It might be a Magento bug indeed, this particular shop is running on Magento 2.1.16 which is a bit outdated, so it might be a bug in that old version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants