I have some fairly complex logic that sets the title of a product display node, currently via hook_node_submit().
The products attached to that node will update their titles automatically the next time the user edits those via inline entity form. Good.
But I also need them to update their titles immediately when the parent product display node is saved with a changed title (and no changes were made to the products. The product attributes must be retained in the new titles along with the changed parent node title.
What's the best way to handle this?
Can I load the CommerceProductInlineEntityFormController for the inline entity form and call its methods, when all I have is $node, $form and $form_state? A small example would suffice.
Comments
Comment #2
johnpitcairn commentedI have hacked up something that works for my specific product type, incorporating the relevant parts of
CommerceProductInlineEntityFormController::attributes()andCommerceProductInlineEntityFormController::save(), but if anyone can point me to a cleaner way to deal with this without the code duplication, please do.Comment #3
Anonymous (not verified) commentedI've been looking for a solution to this problem too. It would only make perfect sense that the variation titles would be updated too if the auto generation is enabled.
Or better, there should be a checkbox on the parent node edit page that would let you choose if you want to update the titles of the child variations when you save the node.
Comment #4
dcam commentedI'm closing old IEF support issues. Please feel free to re-open the issue if you still require assistance.