Would be nice to have product power tool settings exportable, so you can export the settings with a content type. This might be easier by just moving everything to a content typed variable (uc_product_power_tools_) instead of using a schema, then allowing that variable to be featurized.

Comments

djdevin’s picture

Sorry, I meant uc_product_power_tools_NODETYPE

yaoweizhen’s picture

+1

TR’s picture

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

Provide a patch and I'll add this in to the module. New features need to go into the Drupal 7 version first.

djdevin’s picture

Cool, can actually just keep the schema on second thought. I will try to find some time to do it.

djdevin’s picture

Status:Active» Needs review
StatusFileSize
new2.66 KB

Here is a patch for features integration. It is rolled against 6.x-1.x-dev (need it for a project) but I believe it should apply to any version with minor tweaks.

SocialNicheGuru’s picture

I enabled the patch
I can see the uc power tools option in features

NO STRONGARM VARIABLES
i do not see any variables in strongarm that I can download and enable
"Power Tools" Status is not available for export

I can download it as part of the feature
I see the settings in the features module
but when I enable the feature, no variables are set :(

Edit - I am on Drupal 6.22
There is a "uc_product_enable_nodes" strong-arm variable. is this the one that I have to include to enable my particular content type?
Can I include this in each product feature that I create? Will they conflict because they all will share this variable?

djdevin’s picture

This won't show up as strongarm - it's from the schema, it should show up as 'UC Product Power Tools' in your list.

TR’s picture

Strongarm exports system variables. This module doesn't use system variables for settings. http://drupal.org/node/1198864

SocialNicheGuru’s picture

So I thought that if I included product power tools via the patch that all values previously entered would be maintained.

however when I enable the feature on a new site none of the values are present.

SocialNicheGuru’s picture

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

Did you mean to return '$pipe', an empty array, in the following code in your patch?

function uc_product_power_tools_features_export($data, &$export, $module_name) {
+  $pipe = array();
+  $export['dependencies']['uc_product_power_tools'] = 'uc_product_power_tools';
+
+  foreach ($data as $component) {
+    $export['features']['uc_product_power_tools'][$component] = $component;
+  }
+
+  return $pipe;
SocialNicheGuru’s picture

I figured out why the patch wasn't working for me.
Every time i enable the feature, I have to revert changes. Once I do that, then the settings are there.

SocialNicheGuru’s picture

Whenever I use manage class to create a product
I then use product power tools to modify the settings.

Whenever I enable a feature with product power tools, the settings are always overriden to FALSE. Please see attachment.

can anyone help with this? Is there a setting that I missed somewhere?

thanks!

djdevin’s picture

Are you saying your post in #11 didn't work? That diff means the feature is overridden, and needs to be reverted for the changes to be made. I suppose we can make a change to automatically revert changes if there isn't a record for it already.

SocialNicheGuru’s picture

It finally did.

But every time I enable the feature on a new site and goto the features page, it is overridden. I don't know why.

I would think that if I enable a feature for the first time on a site that all of my settings would automatically take.

djdevin’s picture

It should. Give me some time to work on it and I'll make sure that works.

djdevin’s picture

This one should be better, I forgot to add the _rebuild() hook which was probably causing the records not to create on first enable.

SocialNicheGuru’s picture

Can this be ported to D7 if need be? I haven't actually tried it to see if it is an issue.

djdevin’s picture

Not tested, but I think it should work as-is.

djdevin’s picture

Version:6.x-2.x-dev» 7.x-1.x-dev
Issue summary:View changes

Just saw there was a new release, cool.

We still use this patch and it works in D6 & D7.

stefan.r’s picture

Thanks. Can anyone else review this so we can get it to RTBC?

stefan.r’s picture

Thanks. Can anyone else review this so we can get it to RTBC?