If all of a fields settings are locked, then the visibility of the permisions matrix doesn't get adjusted based on the selection of the radio button. For example, if you are using the Media Gallery module, all of the field settings sare controlled by the module itself and are locked down when you go to edit the field. There are no settings to edit on the page. When you have the field_permissions module enabled, it inject itself into the form. However, the States API code is looking for matrix as a child of the [field] form element.

':input[name="field[field_permissions][type]"]' => array('value' => (string) FIELD_PERMISSIONS_CUSTOM),

But, this does not exist - or at least, not in te format that field_permissions is expecting it to.

Normal field:

<div id="edit-field-field-permissions-type" class="form-radios"><div class="form-item form-type-radio form-item-field-field-permissions-type">
<input type="radio" id="edit-field-field-permissions-type-0" name="field[field_permissions][type]" value="0" checked="checked" class="form-radio">  <label class="option" for="edit-field-field-permissions-type-0">Public (author and administrators can edit, everyone can view) </label>

</div>
<div class="form-item form-type-radio form-item-field-field-permissions-type">
<input type="radio" id="edit-field-field-permissions-type-1" name="field[field_permissions][type]" value="1" class="form-radio">  <label class="option" for="edit-field-field-permissions-type-1">Private (only author and administrators can edit and view) </label>

</div>
<div class="form-item form-type-radio form-item-field-field-permissions-type">
<input type="radio" id="edit-field-field-permissions-type-2" name="field[field_permissions][type]" value="2" class="form-radio">  <label class="option" for="edit-field-field-permissions-type-2">Custom permissions </label>

</div>
</div>

Media Gallery field:

<div id="edit-type" class="form-radios"><div class="form-item form-type-radio form-item-type">
<input type="radio" id="edit-type-0" name="type" value="0" checked="checked" class="form-radio">  <label class="option" for="edit-type-0">Public (author and administrators can edit, everyone can view) </label>

</div>
<div class="form-item form-type-radio form-item-type">
<input type="radio" id="edit-type-1" name="type" value="1" class="form-radio">  <label class="option" for="edit-type-1">Private (only author and administrators can edit and view) </label>

</div>
<div class="form-item form-type-radio form-item-type">
<input type="radio" id="edit-type-2" name="type" value="2" class="form-radio">  <label class="option" for="edit-type-2">Custom permissions </label>

</div>
</div>

Notice the difference in the element names.

Comments

mrfelton’s picture

The problem is actually a bit deeper than that. There aren't even any submit buttons on the form, because the entire field settings form isn't rendered if there are no field settings.

mrfelton’s picture

Actually, this may be a problem for Media Gallery to solve. It's a similar issue to these:

#1202642: Allow setting defaults for media-gallery content type fields
#922570: Allow gallery content to be public or private

turion’s picture

Is this also an instance of the same bug?
#2081565: Cannot edit custom permissions for name field on user