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

sherakama’s picture

Status: Active » Fixed

Thanks for this.

I have pushed a commit that should resolve this as well as implemented a validation function.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.