Follow stores links in its own database table. It would be great if this could be made exportable with Features (or just changed to use the variable_{set,get,del} functions, as then Strongarm could be used).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ezeedub’s picture

+1

jec006’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
6.32 KB

Here is a patch which adds ctools export integration so that the settings can be exported through features.

jec006’s picture

Status: Active » Needs review

Marking as needs review.

jec006’s picture

Here is a second patch to make this work for older versions of drush make. Just removed a/ and b/

RobLoach’s picture

Status: Needs review » Needs work

Definitely would be nice to have Features support here!

+++ follow.moduleundefined
@@ -659,21 +669,39 @@ function follow_settings_form() {
-
-  $sql = "SELECT * FROM {follow_links} WHERE uid = :uid ORDER BY weight ASC";
-  $result = db_query($sql, array(':uid' => $uid));
+  $result = ctools_export_load_object('follow_links', 'conditions', array('uid' => $uid));
 
   foreach ($result as $link) {

Not sure about depending on CTools for the module. Maybe have it check if the module is enabled first?

jec006’s picture

ah, yes, that makes sense rob - i can try to re roll the patch

RobLoach’s picture

Are we just changing the field name from name to machine_name? Do we need the additional field for this?

mrfelton’s picture

A lot of code got added to my feature, and after installing on another copy of the site, it's showing as being in its default state, but non of the follow links that I enabled are actually enabled, and the links are not set.

rypit’s picture

Attached is a patch based on #4 that adds ctools export functionality if ctools exists, without adding ctools as a dependency.

rypit’s picture

Status: Needs work » Needs review
mpgeek’s picture

I was able to get an export of the follow links to install as a bulk_export module, but I'm not seeing anything in the features 2.x UI. Is there another step to get it to work with Features? Or is this how it is intended at this point?

UTAN_dev’s picture

I have two questions:

1) I'm having trouble applying the patch at #9. I'm using Follow 6.x-1.5. Here's the output:

$ patch < 1184896-follow-add-ctools-export-9.patch --verbose --binary
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/follow.install b/follow.install
|index 5a1be4f..4691488 100644
|--- a/follow.install
|+++ b/follow.install
--------------------------
Patching file follow.install using Plan A...
Hunk #1 succeeded at 18 (offset -9 lines).
Hunk #2 succeeded at 45 (offset -9 lines).
Hunk #3 succeeded at 82 (offset -9 lines).
Hunk #4 succeeded at 200 with fuzz 2 (offset 72 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/follow.module b/follow.module
|index 38c20cb..93cea60 100644
|--- a/follow.module
|+++ b/follow.module
--------------------------
Patching file follow.module using Plan A...
Hunk #1 succeeded at 437 (offset -7 lines).
Hunk #2 succeeded at 471 (offset -6 lines).
Hunk #3 succeeded at 673 (offset 16 lines).
Hunk #4 succeeded at 703 (offset 16 lines).
Hunk #5 succeeded at 732 (offset 16 lines).
Hunk #6 FAILED at 726.
Hunk #7 succeeded at 766 (offset 16 lines).
1 out of 7 hunks FAILED -- saving rejects to file follow.module.rej
done

This is my first time patching a module. What am I doing wrong?
Thanks!

johnnydarkko’s picture

@UTAN_dev - The proposed patches applies to the 7.x-1.x version of the module... usually 7.x patches aren't compatible with 6.x versions of modules.

johnnydarkko’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
14.79 KB

Applied the patch from #9 to 7.x-1.x-dev (April 30, 2013, ac3b3c).
Patch applied with no problems, was able to export the variables and port them into a fresh site with no problems!
The variables are prefixed with a "0_" is that something that can be addressed? Not very important, but doesn't seem like a clean interface either:
Export variable names

Also, a 7.x-2.x reroll would be awesome!

jhedstrom’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
7.2 KB

Here is a reroll for 2.x. This works in my local testing. I also removed the 0_ from the site-wide exports, user-specific exports could still happen with a pre-pended uid.

AstonVictor’s picture

Status: Needs review » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks