Closed (fixed)
Project:
Micro
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2011 at 00:04 UTC
Updated:
26 Mar 2012 at 00:00 UTC
Jump to comment: Most recent file
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).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | micro-cannot_delete-1046934-3.patch | 1.28 KB | Matthew Davidson |
Comments
Comment #1
murtza commentedi 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.
Comment #2
blazey commentedError 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
Comment #3
Matthew Davidson commentedAbove two fixes combined. Works for me.
Comment #4
Matthew Davidson commentedCommitted.