Closed (won't fix)
Project:
Salesforce Suite
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2009 at 08:01 UTC
Updated:
10 Dec 2012 at 15:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
Sid_M commentedHmmm, seems the I didn't attach the patch. Trying again.
Comment #2
Bevan commentedCan you enlighten me on what you mean by cascade? Where can I see more about the module you are working on? Do you plan to contribute to SF API module? Or as it's own Drupal.org contrib module?
The feature and patch seem fine, however the patch uses too much indentation; two space characters is standard. Also, it should be created from salesforce root directory.
Comment #3
Bevan commentedI found this at #507800: Check for existing duplicates on object-create
Comment #4
Sid_M commentedYes, the issue you reference is the one to which I was referring.
What I mean by cascading is this. A module, such as the one you found, may have its own data tables where it stores information about fieldmaps. In the case of my module, I'm storing the names of fields to use for a fieldmap's initial synching of an object (that's vague, but is explained in the other issue). So my module has a table where each row corresponds to a row in the fieldmaps table. If a fieldmap is deleted, it's good practice for me to delete any of my module's data which is related to the deleted fieldmap. That's what I mean by cascading: the delete starts with the original object (in this case a fieldmap), and cascades down to all related objects. The sf api handles cascading internally by deleting all object maps which relate to a deleted fieldmap. So I want a hook which notifies my module (and any other interested modules) when a fieldmap is deleted, along with the id of the deleted fieldmap. I hope that adequately clarifies. If not, please let me know what's unclear. Thanks.
Comment #5
Bevan commentedThanks Sid. That makes sense. I think at least one other SF API maintainer needs to weigh in on this. I agree in principle, but I'm not sure this is the best method. Some minor style issues in #2 remain unaddressed.
Comment #6
aaronbaumanhook_sf_fieldmap_deletedseems reasonable to me,though i might rename it to
hook_sf_fieldmap_delete.Does it make sense to implement other hook_nodeapi-style CRUD hooks for fieldmaps as well? (In another issue of course)
Bevan, can you propose another method of implementing this?
Comment #7
Bevan commentedI agree that hook_fieldmap_delete() is better name than hook_fieldmap_deleted(). Mostly because it's more consistent with drupal's naming conventions.
Since #507800: Check for existing duplicates on object-create is probably going to be in SF API's package and maintained alongside SF API, it's okay for salesforce_api.module to be aware of sf_prematch.module and it's functionality. Also, I can't see a likely use case for any other module caring about this hook (Maybe I'm missing something?).
So it would be simpler and more efficient to do something like
With this approach, that change should be in #507800: Check for existing duplicates on object-create's patch. What are the disadvantages of this approach?
Comment #8
aaronbaumanBevan's point about efficiency is especially relevant since implementation of
hook_sf_fieldmap_deletein sf_prematch is a one-liner. I've rolled up sf_prematch into a side-by-side module of this package. Functionsalesforce_api_fieldmap_deletewill simply callsf_prematch_match_by_delete.see http://drupal.org/cvs?commit=332864
If there is further demand for this hook, please un-postpone this ticket and state your case.
Comment #9
kostajh commented