Active
Project:
Flot for Drupal 7
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Dec 2018 at 15:41 UTC
Updated:
21 Dec 2018 at 05:35 UTC
Jump to comment: Most recent
Hi All,
I have create a module and inside .module file, am using hook function.
mymodulename_field_collection_item_delete($field_collection_item) {
$itemID = entity_id('field_collection_item', $field_collection_item);
$fc = entity_load_single('field_collection_item', $itemID );
$pid = $fc->field_product_guid['und'][0]['value'];
$responseAPI = json_decode(deleteProductRequestAPI($pid,"DELETE"), true);
if($responseAPI['status']=='success'){
drupal_set_message(t('Is successfully deleted.'));
}else{
drupal_set_message(t('Failed to deleted.'));
}
die;
}
// here curl request sending
functin deleteProductRequestAPI($pid,$method){
// here i have written code for send request and will
// get response in status as "success" or "failed".
}
above code is working on success but when i get from responseAPI status as "failed" then how to prevent or stop further statement to not to delete the item of field collection from drupal.
Field Collection name - Products
Content type is - Brands.
I need to know the hook before deleting field collection item so that i will trigger and implement my logic
Thanks!!
Comments
Comment #2
ramanaraju_s commented