I came across this problem that the changes I make on the conditional fields settings tab would have no effect. Looking through the code I found that in the hook_nodeapi it loads the variable keyed with the node type, but the node type is read from the form and that is the human readable form. This patch uses the machine readable version of the node type. There might be an issue using the arg() function to get it but I couldn't see it anywhere else. Note this is not an issue if your human readable node type name is the same as the machine readable. Hope this helps.

--- web/drupal_files/modules/conditional_fields/conditional_fields.module-orig  2009-01-23 21:53:46.000000000 +0000                                         
+++ web/drupal_files/modules/conditional_fields/conditional_fields.module       2009-01-23 21:55:40.000000000 +0000
@@ -139,7 +139,8 @@
 }

 function _conditional_fields_admin_submit($form, &$form_state) {
-  $type = $form['#parameters'][2];
+  #$type = $form['#parameters'][2];
+  $type = arg(3);
   if ($form_state['values']['reset'] == 1) {
     conditional_fields_node_type_delete($type);
     $message = t(' All configured conditional fields have been deleted.');
@@ -152,7 +153,7 @@
   variable_set('c_fields_edit_' . $type, $form_state['values']['orphaned_edit']);
   variable_set('c_fields_show_all_' . $type, $form_state['values']['show_all']);

-  drupal_set_message(t('Conditional fields options for this content type saved.') . $message);
+  drupal_set_message(t('Conditional fields options for this content type (@type) saved.', array('@type'=>$type)) . $message);
 }

Comments

peterpoe’s picture

Status: Needs review » Fixed

The problem was caused by the wrong variable stored as parameter in conditional_fields_menu():

'page arguments' => array('_conditional_fields_admin', $content_type['name']),

should be:

'page arguments' => array('_conditional_fields_admin', $content_type['type']),

I fixed this and committed directly, since it is trivial.

Status: Fixed » Closed (fixed)

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

kenorb’s picture