- First commit to issue fork.
- 🇦🇺Australia VladimirAus Brisbane, Australia
vladimiraus → changed the visibility of the branch 3077612-missing-handling-of to hidden.
- Merge request !442Missing handling of null return type in ProductVariationTitleWidget → (Open) created by VladimirAus
- 🇮🇱Israel jsacksick
Hm... How do we end up in this situation?
// Otherwise, fallback to the default. if (!$selected_variation) { $selected_variation = $this->getDefaultVariation($product, $variations); }
So getDefaultVariation() would return NULL if none of the variations referenced is published, or if there is an event subscriber setting the default to NULL.
IN this case, I don't believe defaulting to the first variation referenced makes sense? As this should have been covered by getDefaultVariation() unless no published variation is referenced or in case of an override.With this change, there is a risk in selecting a variation that is not published that the customer shouldn't have access to.
- 🇩🇪Germany jurgenhaas Gottmadingen
Well, I would disagree that this is a "Won't fix", it's at best an "Outdated". The issue is 6 years old and it addressed what was committed in https://git.drupalcode.org/project/commerce/-/commit/d49f54408bb3bdfdc1b... which allowed
$selected_variation = $this->getDefaultVariation($product, $variations);
to receive a NULL which was unhandled afterwards.In the meantime, that method does not return NULL anymore, so the fix is not required anymore.