- 🇩🇰Denmark nicklasmf
What is status on this as I see fails on the latest build?
- Status changed to Needs review
about 1 year ago 12:08pm 8 November 2023 - last update
about 1 year ago 773 pass, 3 fail - 🇳🇱Netherlands arantxio Dordrecht
I've updated some of the tests, this is because the variation has to be reloaded.
Included the interdiff. - last update
about 1 year ago 771 pass, 6 fail - 🇳🇱Netherlands arantxio Dordrecht
Some test fail because off the javascript test instability, but I saw one test that i seem to have missed, so here is a updated patch.
- 🇮🇱Israel jsacksick
hm... Not really in favor of committing this as this could lead to the variations being saved multiple times and could potentially lead to data loss.
- 🇬🇧United Kingdom griz
So that's it? Product variations keep the title they got when the product was first created unless:
- The site builder installs this patch
- The site builder installs commerce_bulk and the site admin remembers to use this to re-save the product variations after modifying a product. Give that a 50% chance at best.
- The site builder creates a VBO view that the site admin remembers to use to re-save the variations
If this isn't going to make it into commerce, it should be a module. Adding a second submit button for "Save and update variations" would be my preferred method.
I would like to do this myself but I've already spent too long on the project that most needs this so it won't be any time soon :( - 🇮🇱Israel jsacksick
Well, there are sites that have thousands of variations, so resaving all variations whenever a product is saved is really bad performance wise IMO.
- 🇧🇪Belgium rp7
The variations can be re-saved in the background (through a queue). So that removes the performance bottleneck.
- 🇮🇱Israel jsacksick
@rp7: Now that I think about it... I'm actually wondering why we aren't generating variation titles / labels on the fly... Afaik, one would always call the label method? Or maybe
$variation->getTitle()
which actually returns the field value in which case this would be a problem.My point is, if we were simply overridding the
label()
method to add our logic there, we wouldn't need to care about "stale" titles right?So the title would always be up to date as we'd prepend the product title from there?
- 🇧🇪Belgium rp7
@jsacksick
Might be a good idea to consider!
(not entirely sure how that would play with cacheability & invalidation, something to research) - 🇬🇧United Kingdom griz
@jsacksick Generating the variation title seems like the best solution to me.
It occurs to me that there will almost certainly be sites out there that reference the product variation title in order screens, invoice templates etc. The result is that when a product title changes, they will show that the customer ordered something they did not (or at least, the title was different when they placed the order). I suppose that any rendering of an order or a list of orders should use the order_item label instead, but that doesn't help the site builders who've done it that way and would need to update their templates and views.
This is the case regardless of whether the variation titles are batch-generated after a product title update, or generated on the fly.
For that reason I think this should be a contrib module that could make its way into commerce core in the next major version? - Status changed to RTBC
3 months ago 3:53pm 7 August 2024 - 🇦🇺Australia jannakha Brisbane!
This is a very important fix!
I've got lots of products with max 1 variation and updating product title doesn't update product variation title.
It creates issues with views and messes up all the data.If title of the variations is not autogenerated - they are not going to be updated.
Patch #39 fixes the issue.
Old way of running tests is no longer supported. - First commit to issue fork.
- Merge request !368Issue #2929721 by lawxen, arantxio, zengenuity: Auto generated product variation title does not change when product title changes → (Open) created by plopesc
- 🇪🇸Spain plopesc Valladolid
Current approach worked for us, but we had some issues with internal tests, so we had to make a few minor adjustments.
Created MR with our last version.
Agree that it could cause some performance issues, but for now, it solves the bug while a new approach is defined.