I can create a normal group and have the conditional values be turned on or off. If the group is a multigroup, it doesn't work, all the form elements are visible, even the conditional ones.

The content_multigroup module has to be turned on by creating a content_multigroup.info file, read the README.txt.

Comments

peterpoe’s picture

Postponing all compatibility with non-core cck modules to future releases.

peterpoe’s picture

Status: Active » Postponed
kenorb’s picture

Status: Postponed (maintainer needs more info) » Postponed
kenorb’s picture

Status: Postponed » Postponed (maintainer needs more info)

What have to be done to make it working?

bfsworks’s picture

Status: Postponed » Needs review

As the multigroup module is now apart of an official cck dev branch, now might be to time to take a look at integrating this functionality.

Michsk’s picture

i to need this so +1

bfsworks’s picture

Have offered to help fund moving this along. Any other contributions?

Michsk’s picture

i could test some things, but i am no coder

servantleader’s picture

Easy fix:

On line 618:
Change:

if ($controlled_fields[$element]) {
  // Group markup is still hardcoded.
  $form[$element]['#prefix'] = '<div id="conditional-' . conditional_fields_form_clean_id($element) . '" class="conditional-field controlled-field">';
  $form[$element]['#suffix'] = '</div>';
}

To:

if ($controlled_fields[$element]) {
  // Group markup is still hardcoded.
  $form[$element]['#prefix'] = '<div id="conditional-' . conditional_fields_form_clean_id($element) . '" class="conditional-field controlled-field">' . $form[$element]['#prefix'] ;
  $form[$element]['#suffix'] = $form[$element]['#suffix'] . '</div>';
}

By overwriting #prefix and #suffix this module breaks any other module that adds markup. This needs to be fixed throughout the module. Someone that has the time can make this into a patch.

peterpoe’s picture

Title: Conditional fields does not work with CCK submodule content_multigroup » Compatibility with CCK submodule content_multigroup
Component: Code » Compatibility w/ other modules
Category: bug » feature
Status: Needs review » Postponed

@servantleader: committed your proposed fix to dev, thanks!

@bfsworks: I answered to your message: if all you needed was controlling multigroups as a whole, this fix is enough. But if you need to make fields controlling/controllable inside a multigroup, there's a lot more work to do...

Changing this issue to tracking bug for full compatibility with content_multigroup.
(Question: anyone knows if there will ever be a cck 3 for Drupal 6, or if it will only be for D7?)

jpweber’s picture

I also would very much like this feature.

smscotten’s picture

@peterpoe You say servantleader's fix in #9 is enough for controlling multigroups as a whole? Does this mean I should be able to make a multigroup appear and disappear based on a controlling field? I'm asking because I'm not seeing that and I don't know whether I simply misunderstood or if it isn't working for me.

Miria’s picture

I have the same question, and wondering if I misunderstood #10. I am using the dev branch of this module because I very much need this feature with multigroup, but the multigroup that I have set as controlled still seems unaffected by the controlling field.

Miria’s picture

Correction to my above post: the dev version does work with multigroup. What it doesn't work with is Fieldgroup Tabs. When I disabled the fieldgroup tabs module, the controlled multigroup disappeared just like it was supposed to. However, with the module enabled, all the fields in the multigroup do disappear, but the "empty" tab still remains. So scratch what I said above, the dev seems to work fine with the basic multigroup.

jeff.k’s picture

+1 Subscribed for conditional fields inside a multigroup section

neopulse’s picture

It doesn't work for me, I changed to the dev version ans apply the fix in #9, but i can make a conditional multigroup, I mean appear and disappear. Even in the multigroup config page i can find the section conditional field that appear in others fields.
How you make the multigroup be conditional.
Excuse my english please

benone’s picture

+

extect’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Postponed » Active

There will be a cck 3 for Drupal 6, which will include multigroups (see http://drupal.org/node/484068). So, I guess conditional fields should support multigroups, which does not seem to be the case in 6.x-2.x-dev. To be more precise, when allowing unlimited values on a multigroup, the "Add more values" button has no effect if the multigroup is conditionally controlled by another field.

colordrops’s picture

+1

Bilmar’s picture

+1 subscribing

YK85’s picture

+1 for this feature

does anyone know of a workaround to get conditional fields working for fields within a multigroup at this moment? possibly working with template.php preprocess? this new feature will be a great add to Conditional Fields module and keeping compatible with cck. thanks!

BenK’s picture

Subscribing...

YK85’s picture

Hi peterpoe,

Is there any update on multigroup support?
Multigroup is developing with CCK3

Thanks!

jzornig’s picture

Subscribing

clashar’s picture

subscribing, any news?

pydubreucq’s picture

Subscribing too ;)

bomarmonk’s picture

Subscribe: the development version of conditional fields seems to work with multigroups until I add two conditional fields to a node type with a multigroup. So, maybe the development version is close to getting this working, but not entirely.

bomarmonk’s picture

Actually, I'm using 6.x-2.0-beta1 of conditional fields with multigroups-- the first conditional field I added worked (it was part of a standard field group or set). The second conditional field will not work with a multigroup added to the content type.

gaintsev’s picture

Subscribing

Sknight17’s picture

+17

.kuma’s picture

Subscribing

ss54’s picture

Dear Sir

I would like to test this fix, but which module is this? Can you help please?Will replacement will fix the problem immediately? Thanks

ss54’s picture

Can you please tell me where are these codes existing, in which module, so that I can replace them with the proposed codes by servantleader. Thanks a lot

ionmedia’s picture

Title: Compatibility with CCK submodule content_multigroup » Compatibility with CCK 3x multigroup
Priority: Normal » Major
Issue tags: +CCK Multigroup, +conditional fields

hi, people
my fresh install of drupal with cck 3x and cf (version = "6.x-2.x-dev" core = "6.x" project = "conditional_fields" datestamp = "1304942666") works fine with classic fields, but not work with multi-group fields

step by step how to:

1. create multi-group
2. create 2 fields (controlling and controlled)
3. check conditions - all works fine
4. put both fields inside multi-group
5. check and see, what controlled field always visible and not hides by trigger controlling field values

html code of controlling field is

<select name="group_insurance_policy[0][field_type_of_insurance][value]" class="form-select required" id="edit-group-insurance-policy-0-field-type-of-insurance-value">
...

controlled field

<input type="radio" id="edit-group-insurance-policy-0-field-vehicle-type-value-Легковой-транспорт" name="group_insurance_policy[0][field_vehicle_type][value]" value="Легковой транспорт" class="form-radio required"/>
...

here 0 is a serial key of multigroup "group_insurance_policy"

why we cant control it ? we have all what we need, group name, key and field name

i can quickly help rewrite dev if you tell me which string do this stuff now

ionmedia’s picture

any news? i begin new project and need this asap ;)

mstef’s picture

subscribe..

using 2.x-dev as of today, and nothing at all works inside multigroups.

Uv516’s picture

any news?

filiptc’s picture

Component: Compatibility w/ other modules » Code
Category: feature » bug

3 years old issue. Very needed.

I would mark this as a bug because full functionality is broken with core cck3, which is the base for this module (not just "compatibility with other modules").

dhayalan_ms’s picture

Component: Code » Javascript

CCk multigroup fileds are created using a ajax call,when you click on add more values the the complete muligroup form is rebuild.To trigger onselect , onclick events for these kind fields are not possible with conditional fields javascript.Have to recreate the complete javascript by using two functions

one is .live method in Jquery and another one is Drupal.attachBehaviours.Only live method can trigger click events on ajax created fields.

Drupal.attachBehaviours will bind the object to newly created Dom elements,So when you click on add more values the already fired click event will be preserved.

bakr’s picture

----------
I have created my own javascript solution and used it along with custom js/css module

---------------
Works Perfectly and compatible with JQuery 1.3

Notice I use the .live binding....
-----------------

var matching_url = (byName.search("/edit"));
var matching_url2 = (byName.search("/add"));
if (matching_url > -1 || matching_url2 > -1) {
	$(document).ready(function () {
		// Prepare Master Parameters ************************************************************************************
		function multigroupLookTicker() {
			setTimeout(function () {
				multigroupLook()
			}, 1000)
		}

		function multigroupLook() {
			$("table#group_who_was_involved_values.content-multiple-table.content-multigroup-edit-table-single-column.sticky-enabled.tabledrag-processed.sticky-table.content-remove-buttons-processed tbody tr").each(function (key, value) {
				console.log("-------")
				//	console.log( key + ": " + value );
				// controlling field names...
				var Involved_status = "Select#edit-group-who-was-involved-" + key + "-field-involoved-person-status-value";
				// controlled field names ...
				var Involved_JobTitle = "Input#edit-group-who-was-involved-" + key + "-field-involved-person-jobtitle-value";
				var Involved_Organization = "Input#edit-group-who-was-involved-" + key + "-field-involved-person-org-value";
				// console.log(Involved_Name)
				// --------------------------------------------------
				if ($(Involved_status).val() == "Employee") {
					$(Involved_JobTitle).parent().fadeIn()
					$(Involved_Organization).parent().fadeOut()
				}
				// ---------------------------------------------------
				if ($(Involved_status).val() == "Contractor") {
					$(Involved_JobTitle).parent().fadeOut()
					$(Involved_Organization).parent().fadeIn()
				}
				// --------------------------------------------------
				if ($(Involved_status).val() == "" || $(Involved_status).val() == "Other Person" ) {
					$(Involved_Organization).parent().fadeOut()
					$(Involved_JobTitle).parent().fadeOut()
				}
			});
			// ===================================
			setTimeout(function () {
				multigroupLookTicker()
			}, 1000)
			// ==================================
		}
		multigroupLook()
		$("input#edit-group-who-was-involved-group-who-was-involved-add-more.form-submit").live("click", function () {
			multigroupLook()
		});
		$("body").live("click", function () {
			multigroupLook()
		});
	}); // end of: $(document).ready(function() ...
} // closing: if (matching_url > -1) 

peterpoe’s picture

Issue summary: View changes
Status: Active » Closed (outdated)