1. Principle: Use an unambiguous, stable time zone such as UTC or GMT. 2. Principle: Long running transactions are Evil -------------------- - start script through scheduled task or click of button "Sync Magento Attributes to Drupal Content Types" do rest call and assign result set to attribute_sets array do rest call and assign result set to attributes_inside_attribute_set array loop through attribute_sets array: start update block: update drupal side attribute sets, attributes, and products having that attribute set. -- before update enter server side time of request -- update content type call function _magento_attributes_sync_attributes(int attribute_set_id = REQ, array attributes_inside_attribute_set[] = REQ ); start function: GLOBAL array mandatory_update_all_products; loop through attributes inside attribute set case switch (check if attribute got updated) TRUE map_attribute_type_to_drupal_field_type($attribute); content_field_instance_update(attribute); mandatory_update_all_products['attribute_set_id] = true (check if attribute is a new field) TRUE map_attribute_type_to_drupal_field_type($attribute); content_field_instance_create(attribute); mandatory_update_all_products['attribute_set_id] = true delete the attributes to be updated/created inside the attribute set inside logs end loop; end function; call function _magento_attributes_sync_fields(int attribute_set_id = REQ, array attributes_inside_attribute_set[] = REQ ); start function: loop through fields inside magento_content_type (check if field is present as an attribute inside attribute set) TRUE content_field_instance_delete($field) mandatory_update_all_products['attribute_set_id'] = true end loop; end function; loop through attribute sets that got update thus will have to update the products too *** this is where batch api or job queue will be handy. version 2.0 though :) (check mandatory_update_all_products[$attribute_set_id] is true) // function defined in magento_products.module called by maybe both magento_attributes.module and magento_products.module call function magento_products_update_products_by_attribute_set($attribute_set_id); end loop; end update block; end loop attribute_sets; ---------------------