I've just exported a large content type which had many conditional fields. When I re-imported, all of the conditional relationships had been lost. Would be cool if the conditional relationships could export too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

peterpoe’s picture

Status: Active » Fixed

The latest version has content_copy compatibility!
Importing and exporting of conditional fields settings should work now!

peterpoe’s picture

Title: Conditionality information lost on content type export » Import/export compatibility

Please report here any issues with import/export.

KNOWN LIMITATIONS:
- General Conditional Fields options for individual content types (those found in the tab admin/content/node-type/TYPE_NAME/conditional) are not exported/imported
- The data is not checked: so use with care if you edit manually the exported data.

jim0203’s picture

Cool! That just seems to work when I export the custom content type, right?

Anyway, I'm now putting the feature to use in my other issue, http://drupal.org/node/453204.

Status: Fixed » Closed (fixed)

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

loze’s picture

I cant seem to get this to work when importing fields.

peterpoe’s picture

@loze: Could you share your exported data so that I can test? Thanks.

peterpoe’s picture

Status: Closed (fixed) » Active
phayes’s picture

I've successfully moved conditional fields when manually importing / exporting content-type definitions, however, packaging up a content-type as part of a feature as per the features module doesn't seem to keep conditional field settings.

I'm not sure if this is a conditional fields issue, or a features issue.

Cheers and thanks for the awsome module

Patrick

phayes’s picture

Title: Import/export compatibility » Features compatibility

Updating to reflect current status: Works when manually exporting / importing node types, but there is no features integration (http://drupal.org/project/features).

bjcool’s picture

subscribe

batje’s picture

subscribe

mani.atico’s picture

subscribe

mani.atico’s picture

Status: Active » Needs work
FileSize
3.49 KB

Built this rough patch. It's just an approach and needs some work and debugging, but I think it's a good start.

I also tried implementing ctools api, but I thought this was a better approach since no db tables modifications are needed.

Anyway, I think the folloowing issue should be solved to in order to have a complete features integration.
728004: Allow abitrary modules to alter the pipeline

mani.atico’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

The patch is for 2.x-dev

pvhee’s picture

interested in features compatibility as well, thx for the efforts!

franz’s picture

Status: Needs work » Needs review

I'm testing this. If I find anything wrong I'll add a comment.

mani.atico’s picture

Actually, I think that solving issue http://drupal.org/node/784470 should fix features integration.

franz’s picture

mani.atico, I tested the latest patch and it did exported correctly. What kind of issue is going on in exportability?

mani.atico’s picture

I've been working with patch #13 in a production site for a while and features are exported/imported correctly. Currently I haven't found any bugs either. The hook mentioned in #13 could be implemented to export conditional fields automatically when a node type is exported.

On the other hand, if the module was coded as suggested on the issue referenced on #17, conditional fields would be saved as field settings and no fetures integration code will be needed since data would be managed by cck.

phayes’s picture

#728004: Allow abitrary modules to alter the pipeline: is now resolved. So we can go ahead and have this auto-appended to content-type exports.

phayes’s picture

#17 is better in the long run, but it would require a more substantive re-write. #13 should be committed right now, as it gets features integration immediately and does not require any rewrite of anything.

phayes’s picture

Status: Needs review » Reviewed & tested by the community
franz’s picture

phayes, this issue you mentioned is not resolved yet. And how does it affect the current patch? I can't really understand what you want from here, commit as it is or rewrite so that settings are auto-appended to content-type exports?

phayes’s picture

The issue is resolved, but is not closed.

@gordon the patch has been committed with a few tweaks
Setting this to needs work so that you can update the integration patches you have above. Feel free to close when you are done.

However, you are correct, this issue does not affect the current patch. The current patch works well, but does not auto-append. I would recommend committing the patch now as is (it's ready, useful, and tested). We can work on the auto-append magic later.

franz’s picture

Clear as water now! =)

phayes’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
47.97 KB

Whoops. Found a bug. It looks like with multiple feature reverts, conditional field settings don't replace eachother, but start adding up.

See attached image

peterpoe’s picture

Status: Needs work » Fixed

Reviewed, modified export render to user var_export, fixed bug mentioned in #26, and committed. Thanks to all!

Status: Fixed » Closed (fixed)

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

brad.bulger’s picture

can someone confirm if this is right:

  • this is only in the dev build, not in beta2
  • to get conditional_fields settings to export in a feature, we have to explicitly export them - add features[conditional_fields][] = "our_content_type_name" to the info file, or some such step - they do not get exported as part of the content type

thanks

sirkitree’s picture

Hi, I'm looking for documentation on this as well but am not finding it. I did find, that once I installed the latest dev, cleared my cache, and tried to re-create my feature with the exported content type, that Conditional Fields was now an option in Edit Components dropdown:

This added dependencies[] = "conditional_fields" and features[conditional_fields][] = "article" to my .info file, and a new file called [modulename].features.conditional_fields.inc

mstrelan’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

This is not in 7.x is it?

franz’s picture

Version: 7.x-3.x-dev » 6.x-2.x-dev

Please do not hijack the thread.

If the version was 6.x, it is not in 7.x

mstrelan’s picture

Fine. New issue created at #1191248: Port features compatibility to 7.x-3.x. Maintainer can decide if he wants to close that as a dupe and use this thread instead.

franz’s picture

sorry, mstrelan, I mistook your comment. Now I understand it's purpose to reopen the issue for D7 (if you had changed the sate of it would be clearer) =(

gateway69’s picture

hmm just applied the patch which worked fine but now seeing these errors

Error: Cannot redeclare conditional_fields_features_api() (previously declared in
/var/www/sites/all/modules/conditional_fields/conditional_fields.module:1341) in
/var/www/sites/all/modules/conditional_fields/conditional_fields.module, line 1448

Fatal error: Cannot redeclare conditional_fields_features_api() (previously declared in /var/www/sites/all/modules/conditional_fields/conditional_fields.module:1341) in /var/www/sites/all/modules/conditional_fields/conditional_fields.module on line 1448
aniket.mohite88’s picture

Issue summary: View changes

Thanks to kenorb's patch, available here
https://www.drupal.org/node/2210241

I was able to solve this.
Can export the conditional field settings (along with content-type & fields).
In my case the dependent is a Date field & dependee is a boolean field.

Conditional field 7.x-3.0-alpha1
features 7.x-2.2

Leeteq’s picture