Features is getting more and more actual.

I'm trying to make use of Features in my development→production workflow.

Automatic NodeTitles is one of modules that won't preserve its settings in a feature.

Please don't fall behind.

Comments

ahtih’s picture

As a workaround, Strongarm module can be used to make Automatic Nodetitles settings to be Features; this is because Automatic Nodetitles settings are Drupal variables (all beginning with "ant_"), and Strongarm makes these usable in Features.

lolmaus’s picture

Can Strongarm be used by end user? Or it is an API provider that requires module's modification?

ahtih’s picture

Yes it can be used by an end user, without modification of code in Automatic Nodetitles or Strongarm.

maddentim’s picture

Features support would be valuable to my work. Thanks,

hefox’s picture

There's a patch (that need update?) in #728004: Allow abitrary modules to alter the pipeline where auto node title can tell features to automatically export variables when the node type is.

phayes’s picture

Uploading here to speed the process. Note that this patch needs some tweaks

phayes’s picture

Status:Active» Needs work
Cyberwolf’s picture

Subscribing.

vegeneric’s picture

subscribing

TravisCarden’s picture

Issue tags:+Features integration

subscribe

rupl’s picture

Status:Needs work» Needs review
StatusFileSize
new628 bytes

I tested the patch in #6 and was able to encapsulate my Automatic Nodetitle settings into a Feature. I fixed a typo and rerolled using git.

My apologies, I got my dev environments confused while testing this. As mentioned in #1, this patch is unnecessary if you use Strongarm to capture your Auto Nodetitle settings.

tim.plunkett’s picture

Version:6.x-1.x-dev» 7.x-1.x-dev
StatusFileSize
new899 bytes

Rerolling for D7.
The hook has changed some since the last couple patches, in both name and parameters.

tim.plunkett’s picture

StatusFileSize
new906 bytes

Here's the D6 version. Same thing, but "Implementation of" instead of "Implements" to match.

Jody Lynn’s picture

Status:Needs review» Reviewed & tested by the community

Both Tim's D6 and D7 patches are clean and tested.

TravisCarden’s picture

Title:Features support» Add Features support to Automatic Nodetitles

...because every time this thread pops back up I forget what module it's for! :)

emman31’s picture

Subscribing !

Need this !

zilverdistel’s picture

subscribing

Works with strongarm, but would be nice if either the variables were named "auto_nodetitle_***" or if the settings were automatically saved with the content type to the feature.

tim.plunkett’s picture

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:Reviewed & tested by the community» Needs review
StatusFileSize
new1.31 KB

After running into #1078478: Multiple features and strongarm conflicts and #904558: Multiple features and strongarm conflicts, this needs to follow their lead.

This is for D6, I'll see if I can do a D7 version later.

mstrelan’s picture

subscribe

fago’s picture

patch in #18 looks good to me, any testers?

Shadlington’s picture

Subbing

Manuel Garcia’s picture

Status:Needs review» Reviewed & tested by the community

I've just done some testing, and the variables seem to be exported fine (using php code on two content types in the same feature, both got into the feature strongarm file).

I haven't tested pushing the feature around nor installing it on a new installation, but I suppose it should work fine since then strongarm/features would take care of that.

Looks good to me!

[edit]
I also just checked and the vars got into the features[variable][] array in the .info file as well.
[/edit]

HitmanInWis’s picture

I tried the patch in #18, but for whatever reason it is not working for me. When I put some logging into the features module, I can see the variables get added to $pipe, but the export does not contain the data. Any ideas on where to look?

barraponto’s picture

@HitmanInWis did you enable Strongarm?

HitmanInWis’s picture

Ah - nope - I didnt realize it was a requirement/dependency. I'll try that.

WorldFallz’s picture

Just another data point, patch in #18 works great (it does require strongarm to be enabled) and the node titles are created properly on the feature enabled site.

Any chance this can be committed to the dev?

hefox’s picture

Patch #18 is dependent on another issue, which needs work

fago’s picture

So should we postpone committing #18 until strongarm is fixed?

crea’s picture

Subscribing

deviantintegral’s picture

#18 is working fine for me as well.

I'm not sure what the dependency on #1078478: Multiple features and strongarm conflicts is? If this is still the case, it would be great if someone could summarize it and mark this issue as postponed.

hefox’s picture

How this ticket is done, whether the first simple patch, or the more complex patch is, depends on which patch gets in, so postponed sounds appropriate

tim.plunkett’s picture

Version:6.x-1.x-dev» 7.x-1.x-dev
Status:Reviewed & tested by the community» Postponed
the_g_bomb’s picture

Status:Postponed» Needs work

Un-posponing due to a fix on the above issue.

Jim Kirkpatrick’s picture

Status:Needs work» Reviewed & tested by the community

So how's this going?

Is the D7 patch in #12 (and its D6 variant in #18) ok? They were tested and ready, then the Strongarm issues in #20-32 were overcome... Are we ready to put a patch in dev yet?

Optimistically changing status back to what it was before it was postponed...

subhojit777’s picture

Patch submitted in #18 is working fine in my site. But there's a problem, it cannot auto detect "Automatic Nodetitle" module and you have to explicitly add this in dependencies. I suggest the auto detection of Automatic Nodetitle module must also be implemented in the patch.

Jim Kirkpatrick’s picture

Status:Reviewed & tested by the community» Needs work

Agreed, updating.

Angry Dan’s picture

Sorry if I'm late to the conversation here, and you've already discussed this, but you should really implement this using hook_features_pipe_COMPONENT_alter() to create auto_nodetitle_features_pipe_node_alter() which adds dependency info to the node directly.

The strongarm module already has an implementation of this function for adding comment and menu settings to the node when you export it.

Angry Dan’s picture

Just looked at the patch... seems I'm very late to the conversation!

chrowe’s picture

Is this issue still alive. Can we commit the patch and add auto detection later?

Angry Dan’s picture

Status:Needs work» Needs review
StatusFileSize
new1.13 KB

Just created a patch - tested on D7 - with dependency support.

I think this is how you do it?

<?php
$export
['dependencies']['auto_nodetitle'] = 'auto_nodetitle';
?>

But correct me if I'm wrong, it seemed to work!

hefox’s picture

+++ b/auto_nodetitle.module
@@ -236,3 +236,33 @@ function auto_nodetitle_node_type($op, $info) {
+        $variable_name = "{$variable_name}_{$node_type}";
+        // This variable isn't going to be exported within this feature.
+        // But it is being exported.
+        if (isset($map[$variable_name]) && $map[$variable_name] != $export['module_name']) {
+          $export['dependencies'][$map[$variable_name]] = $map[$variable_name];
+        }

This stuff should not be needed anymore

claudiu.cristea’s picture

I tested #40 and works. I cannot understand the comment from #41. Hey @hefox, can you explain?

claudiu.cristea’s picture

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

Status:Reviewed & tested by the community» Needs work

Features does that part automatically; not needed to be reimplemented here

+++ b/auto_nodetitle.module
@@ -236,3 +236,33 @@ function auto_nodetitle_node_type($op, $info) {
+          $export['dependencies']['auto_nodetitle'] = 'auto_nodetitle';

Why is a dependency being added without even checking if ant is configured for this node type?

claudiu.cristea’s picture

@hefox, You may be right. I cannot provide a rework of the patch because I don't know how Features works. I just need this functionality and I'm able to test provided patches. Why don't you provide a better patch so that I can test it? :)

hefox’s picture

Patches in #13 likely are all that's needed. strongarm/features did have some bugs that have been resolved that caused the addition of the dependency logic

claudiu.cristea’s picture

Status:Needs work» Reviewed & tested by the community

Tested #13. The patch applies cleanly and works as expected.

RTBC for #13.

discipolo’s picture

Issue summary:View changes

confirm:
patch 12 works on d7.

drupalninja99’s picture

StatusFileSize
new752 bytes

I had to reroll the patch for d7 and fix the function comment to match d7 standards.

tsi’s picture

StatusFileSize
new556 bytes

#49 works fine for me, only that the paths were relative to drupal root, this version is relative to the module root.

jp.stacey’s picture

#50 works great for me: re-creating an existing feature adds new strongarm variables to it; enabling that feature on a clean site populates the relevant auto_nodetitle fields. Thanks to everyone involved so far!

mrded’s picture

I can confirm that #50 works great. Thank you!

mrded’s picture