The fix in #1700378: Number of Page Variants is causing feature-defined page variants to be overridden.

Our scenario is that we have a number of default page variants defined by our features. And when clients in an individual site want to override a given variant, we clone a default one, modify it, and set the weight lower than the default. The recent patch removed our ability to do that. The weights in our features are not respected.

Comments

jastraat created an issue. See original summary.

jastraat’s picture

Title: Page Variant weight from features overriden » Page Variant weight from features overridden
jastraat’s picture

Title: Page Variant weight from features overridden » Regression: Page Variant weight from features overridden
rivimey’s picture

When you say 'set the weight lower than the default' can you explain precisely what you do and with how many variants? It seems possible that the new weight value is outside the acceptable range (defined by $delta in the other issue's patch).

The way it's supposed to work is that #weight values are within the range -delta to +delta. I seem to recall that setting a weight to a value outside this range causes strange effects on display. Previously, $delta was set to 30, allowing for 61 possible weights, but the linked patch changed that to be dynamically calculated based on the number of actual page variants.

The only mitigation I can think of would be to do $delta = max(30, count($page->handler_info)/2 + 1), enforcing a lower limit on the range, but that feels wrong to me at present.

jastraat’s picture

> When you say 'set the weight lower than the default' can you explain precisely what you do and with how many variants?

We usually only have around 10 variants in a given site, and all the weights are well within the old range of +/-30. However, with the new code, it changed the weights to a very low numbered range (like 3) and then added decimal places to divide the variants to the required number.

japerry’s picture

Status: Active » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.