delete comments and users

chanifel - July 2, 2008 - 11:22
Project:Flag content
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

There is a mistake in the query of deleting comments and users in function function flag_content_comment and function flag_content_user, the mistake is wrong use of apostrophe around %s
the solution is changing the apostrophe into inverted commas
the correct query is: 'DELETE FROM {flag_content} WHERE eid = %d AND type = "%s"'

#1

kbahey - July 2, 2008 - 14:14
Status:active» postponed (maintainer needs more info)

This is the correct SQL delimiter for char type. There is no problem with using '%s' at all.

Are you using PostgreSQL? What error are you getting that makes you think this is a problem.

#2

Morbus Iff - February 26, 2009 - 14:31
Version:5.x-2.5» 6.x-1.x-dev
Assigned to:chanifel» Anonymous
Status:postponed (maintainer needs more info)» active

The query is incorrect because it's using "eid" and not "fid".

#3

Morbus Iff - February 26, 2009 - 14:34

Actually, I'm not really sure what's going on.
Your .install file uses fid and eid. Your DELETEs use eid.
But the generated table I get is:

+--------------+----------------------+------+-----+---------+----------------+
| Field        | Type                 | Null | Key | Default | Extra          |
+--------------+----------------------+------+-----+---------+----------------+
| fcid         | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| fid          | smallint(5) unsigned | NO   | MUL | 0       |                |
| content_type | varchar(32)          | NO   | MUL |         |                |
| content_id   | int(10) unsigned     | NO   |     | 0       |                |
| uid          | int(10) unsigned     | NO   |     | 0       |                |
| timestamp    | int(10) unsigned     | NO   |     | 0       |                |
+--------------+----------------------+------+-----+---------+----------------+

#4

Morbus Iff - February 26, 2009 - 14:36

This appears to be caused by Flag and Flag Content being installed at the same time.

 
 

Drupal is a registered trademark of Dries Buytaert.