Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Integration with other module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2015 at 07:19 UTC
Updated:
25 Sep 2015 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaPlease try updating to 1.6 and let me know how it goes.
FYI you shouldn't assign an issue to yourself unless you're actively working on it, which isn't applicable for this type of request.
Comment #2
damienmckennaComment #3
jnavane commentedThanks for your update.
Updated version (1.6) doesn't help.
We have a node page with multiple commerce products referred with it. We need to add meta tag for product entities as well (rather than node level). We have a view to load the particular product variation by accessing their product ids. By using the meta tag module we can able to see the meta tag options in product add/edit page. When we are providing values for meta tag attributes, they are not updating.
Please let me know if you need any other information.
Comment #4
damienmckennaPlease help clarify exactly what you're doing - are these products being loaded through a view that is then displayed on a node page?
Comment #5
jnavane commentedYes. you are correct.
For your reference
custom node page url : www.mysite.com/custompath/product/product-name - It loads node page with default product with multiple product variations. (Need to load meta tag from viewing node id)
product page url: www.mysite.com/custompath/product/product-name?pid=12345 - It loads particular product based on the product if we provided. (Need to load meta tag from viewing product id)
We are loading the products using views.
FYI. We are not using default node view page (node/nid) for this. We have implemented, custom menu callback to load the nodes and products using views.
Thanks.
Comment #6
damienmckennaAh, in that case It's kinda working by design - Metatag doesn't have any architecture to automatically load tags from entity A when you're viewing a completely unrelated page B.
What you could do is try using #2396693: Add Token support to insert values from the Views results to insert values from the Views results into Metatag:Views.
Comment #7
jnavane commentedThanks for your update,
Main purpose of this issue thread is, I can't save meta tags for commerce products (add/edit forms at the admin end).
when I try to add meta tags for commerce products, it fails to save meta tags.
Please advise.
Comment #8
jnavane commentedComment #9
damienmckennaArgh! I've just reproduced this problem myself! Dangit.
Thanks for reporting the problem, I'll see about doing up a fix.
Comment #10
damienmckennaFor some reason metatag_metatags_form_submit() isn't being triggered. Oh bother.
Comment #11
damienmckennaI'm (temporarily) moving this over to the Commerce issue queue to see if anyone might have suggestions as to what the problem is.
Comment #12
rszrama commentedCould it be because the Product UI module's product edit form is wrapping another base product edit form? I'm not familiar with how the Metatag module alters forms to add its submit handlers.
Comment #13
damienmckenna@rszrama: Thanks for the update. I didn't have time to dig into Commerce much yet.
FYI Metatag uses a tag-team of metatag_field_attach_form() and metatag_form_alter() to add itself onto the entity form.
Comment #14
rszrama commentedHmm, ok, I'll check it out if I get a minute; are you checking for button level submit handlers vs. just using form level submit handlers?
Comment #15
damienmckennaRight now it's checking for form-level submit handlers, but I noticed that doing so means the Metatag form submission callback is never triggered.
Comment #16
rszrama commentedShould we move this back to the Metatag queue then? I'm not sure what the general policy is for modules blanket altering other modules' forms, but I see two options:
If I'm not mistaken, there are places in Commerce where I've done that to preserve form level handlers in button level submit arrays.
I'm guessing the first option is more easily achievable, but it does depend on ensuring the button you're altering isn't a delete / cancel button. You can probably avoid that by checking to see if the button has #limit_validation_errors set on it, but you may also just depend on only altering the #submit arrays of submit elements actually named submit. That's a fairly strong pattern.
Comment #17
damienmckennaMoving the issue back to Metatag's queue.
I've updated the form handling to check for the alternative submission handler, that part works correctly now, but the bigger issue is that the $form_state['values']['metatags'] items aren't being added to the entity object, as happens with other entities. I suspect I need to do something with Entity API.
Comment #18
jnavane commentedThanks for your updates.
You are correct. For some reasons, we are not getting metatag values ($form_state['values']['metatags']) in hook_entity_update and hook_entity_insert functions.
Comment #19
damienmckennaBumping this to v7.x-1.8, sorry.
Comment #20
manikaprasanth commentedHi Damien,
I added a separate submit handler for commerce product , and it's works fine for me. Here is the patch for I created based on it.
Comment #21
damienmckennaI've confirmed this worked. Yay! Thanks manikaprasanth!
Comment #23
jnavane commentedComment #25
damienmckennaThis needed a little additional work to tidy it up.
Comment #26
damienmckennaA little more tweaking.
Comment #28
damienmckennaCommitted.