shipperhq_shipping_group attribute issue on save
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
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.
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!
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.
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.
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.
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.