Download & Extend

Conflict with field permissions

Project:Conditional Fields
Version:7.x-3.x-dev
Component:Compatibility w/ other modules
Category:bug report
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

The error below occurs when I try to add a content to a content type with conditional fields present (text, long text and term reference) and where these fields have some field permissions set (using the field permissions module.)

The error is showing to users that do not have permission to edit the fields. Users with permissions do not see the error message - all works as normal.

Fatal error: Function name must be a string in /public_html/sites/all/modules/conditional_fields/conditional_fields.module on line 583

Removing the code below from the module c.line 583 seems to fix the problem, but heaven only knows what else I could be breaking!

    // Execute custom behaviors.
    if (!empty($behaviors)) {
      foreach ($behaviors as $behavior) {
        // Custom behaviors are callbacks.
        $$behavior('edit', $form, $form_state, $dependent, $dependencies);
      }
    }

    unset($behaviors);

(Addition...just found out that removing the above breaks quite a lot! Conditional fields elsewhere, available to anonymous user have stopped working...)

Comments

#1

Further investigation. Note that the error is on line 570 of a clean install (no patches)

I don't now think that this error has anything to do with field permissions (as I've removed that module.)

The error occurs when any condition is added into the user section. It is only anonymous users that are affected.

(example condition - field_logo is visible when field_add_contact_details has value "1".)

Rolling back to an earlier version of dev3 (10 August) fixes this issue.

However, the version on 10 August breaks my other conditional fields, as long text and term references weren't playing together nicely back then!

Any help appreciated!

#2

It seems that this issue (and I can't change the title!) of anonymous users getting error messages was also in the D6 version.

There is a fix here for D6.

Can it be fixed for D7? My PHP skills are not up to it - I have tried!

#3

Actually i do concur there is a conflict with field permissions module. With field permissions module enabled I get the following error when i try to create or edit dependencies:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7405 of /home/~/public_html/drupal7/includes/common.inc).

If i disable field permissions, the form opens and i can set dependencies and they appear to work as they should but I can't modify existing or add new dependencies while field permissions is enabled.

#4

Priority:normal» major

any progress on it?

#5

Apparently not... Pity really.

#6

If I can help: the error appears only if I check "Reset the dependent to its default values if the dependency is not triggered." in Node Edit options.

#7

We made many fixes and changes lately, I suspect this issue is fixed, but could someone please confirm?

#8

I can confirm that it's not fixed... using following version of conditional fields module:

; Information added by drupal.org packaging script on 2012-05-05
version = "7.x-3.x-dev"
core = "7.x"
project = "conditional_fields"
datestamp = "1336176488"

and following version of field permissions:

; Information added by drupal.org packaging script on 2012-01-25
version = "7.x-1.0-beta2"
core = "7.x"
project = "field_permissions"
datestamp = "1327510549"

Any thoughts?