I created a Feature that contains two fieldmaps. When I upload my exported Feature to my site, I get the following error:
Fatal error: Class 'salesforce_api' not found in /live-docs/includes/common.inc on line 3596
Looking at the code in my exported feature, I see:
In myfeature.info:
features[ctools][] = "salesforce_api::"
and in myfeature.features.inc:
/**
* Implementation of hook_ctools_plugin_api().
*/
function myfeature_ctools_plugin_api() {
list($module, $api) = func_get_args();
if ($module == "salesforce_api" && $api == "") {
return array("version" => );
}
elseif ($module == "strongarm" && $api == "strongarm") {
return array("version" => 1);
}
}
Seems like the implementation of hook_ctools_plugin_api() is not right in the Salesforce API module. I'll take a look and see if I can get a patch together.
Comments
Comment #1
kostajh commentedChanging:
features[ctools][] = "salesforce_api::"tofeatures[ctools][] = "salesforce_api:salesforce_api:1"and
to
fixes the problem and the Feature works fine.
But the problem is getting this to export correctly when generating the Feature. I can't figure out how to correct this. Aaron, do you have any ideas?
Comment #2
aaronbaumanI have looked at Features examples, begged for help, and beat my head against the wall.
The result is the code that's in dev now.
Comment #3
kostajh commentedThe documentation is a bit sparse isn't it!
Ok, I'll let you all know if I figure it out.
Comment #4
rmontero commentedSubscribing
Comment #5
EvanDonovan commentedTracking for 7.x-2.x.
Comment #6
tayzlor commentedAttaching a patch that should cover the features export bug explained above.
The patch also fixes another problem, whereby reverting the feature from the features admin page does not actually revert the Salesforce fieldmap back to its original state in the database.
This patch should allow successful creation of fieldmaps via features UI, as well as the possibility to revert to default if they are overrridden.
Patch is against the 6.x-2.x branch.
Comment #7
kostajh commentedComment #8
kostajh commentedThis is committed to 6.x-2.x-dev. Thanks @tayzlor! http://drupalcode.org/project/salesforce.git/commit/29426c7
Comment #9
EvanDonovan commentedAwesome, thanks! Will try to commit shortly.
Comment #10
EvanDonovan commentedForgot to bump version. Haven't committed yet since I haven't been using this module with Features export, but will try to do so soon. Probably will have to re-roll to get it to apply.
Comment #11
EvanDonovan commentedHere's a re-rolled version of the patch for 7.x. I haven't committed it yet, since it appears that you can still delete the fieldmap from the fieldmap configuration, and then it no longer shows up, even if you disable and reenable the feature. Is that true in 6.x as well?
Comment #12
EvanDonovan commentedFrom what I recall, the last time that I tested my re-rolled patch for 7.x, it didn't actually make the fieldmap show up when the feature was enabled, so something must be wrong with the patch.
Does anyone have time to look into this further?
Comment #13
tinefin commentedI have looked over the patch in #11 made a few minor corrections and rerolled it against the 7.x-2.x git branch.
It works on our current site for exporting and reverting features / fieldmaps.
Comment #14
tinefin commentedNb: Features seem to not detect sf_entity as a dependency automatically when exporting fieldmaps.
Will have a look at it, but shouldn't affect the general functionality.
Comment #15
tinefin commentedComment #16
nicksanta commentedRerolled to fix an error when features are rebuilt:
One line change on line 55 of the patch from #13:
to
Comment #17
kostajh commentedMarking this as closed. Thanks to those who contributed. See #2124817: 7.x-2.x and 6.x-2.x branches are no longer supported for more info.
Comment #18
nicksanta commentedAny 7.x-2.x users who are still experiencing issues with reverting salesforce_fieldmap components might want to take a look here: #2129603: salesforce_fieldmap features components don't revert correctly in some circumstances