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

ramanaraju_s created an issue. See original summary.

ramanaraju_s’s picture

Assigned: ramanaraju_s » Unassigned