A small typo. micro_delete's arg is Micro, not int:

Index: /var/aegir/7.0/sites/all/modules/micro/micro.pages.inc
--- /var/aegir/7.0/sites/all/modules/micro/micro.pages.inc 
+++ /var/aegir/7.0/sites/all/modules/micro/micro.pages.inc
@@ -258,7 +258,7 @@
   if ($form_state['values']['confirm']) {
     $micro = micro_load($form_state['values']['mid']);
     $micro_type = micro_type_get_type($micro);
-    micro_delete($form_state['values']['mid']);
+    micro_delete($micro);
     watchdog('content', '@type: deleted %mid.', array('@type' => $micro_type->machine_name, '%mid' => $micro->mid));
     drupal_set_message(t('@type %mid has been deleted.', array('@type' => $micro_type->name, '%mid' => $micro->mid)));
   }

But still not works:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND (base.eid = '1')' at line 2: SELECT base.mid AS mid, base.mtid AS mtid, base.uid AS uid, base.eid AS eid, base.created AS created, mt.machine_name AS type FROM {micro} base INNER JOIN {micro_type} mt ON base.mtid = mt.mtid WHERE (base.mtid IN ()) AND (base.eid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1 ) in function EntityAPIController->query() (line 153 in /var/aegir/7.0/sites/all/modules/entity/includes/entity.controller.inc).

Comments

murtza’s picture

i am also facing same problem i can not delete micro fields.i am talking about the micros on the entities..well admin area is quite good and i am in love with this module..i think i can do many thing with this. i will share my idea's here in a few days.

blazey’s picture

Error is caused by _micro_entity_delete function. Line 2079 of micro.module. Wrapping foreach with if statement checking if types are not empty solves the problem

function _micro_entity_delete($entity_name, $entity_type, $eid) {
  $types = micro_types_from_entity($entity_name, $entity_type);
  //TODO - not sure conditions accept arrays
  if (!empty($types)) {
    foreach (micro_load_multiple(FALSE, array('mtid' => array_keys($types), 'eid' => $eid)) as $micro) {
       micro_delete($micro);
    }
  }
}
Matthew Davidson’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

Above two fixes combined. Works for me.

Matthew Davidson’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.