Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have a content (node) type named 'product', a context named 'mobile', and I want use a view mode called 'mobile'. I cannot save these settings.
This is because the validation function expects 3 different values, in contextual_view_modes_settings_form_submit(), in contextual_view_modes.admin.inc
$uniq = array_diff($entries, array_diff_assoc($entries, array_unique($entries)));
// We need all three.
if (count($uniq) !== 3) {
continue;
}
We just need to get all values set, ie different from 'none'.
I have replaced the validation function with :
if (in_array('none', $entries)) {
continue;
}
And it works fine.
Comments
Comment #1
sherakama CreditAttribution: sherakama as a volunteer commentedThanks for this.
I have pushed a commit that should resolve this as well as implemented a validation function.