New reasons cannot be added

ddyrr - July 12, 2008 - 05:12
Project:abuse
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Every time I try to add a new reason, I get the following error:

user warning: Column count doesn't match value count at row 1 query: INSERT INTO abuse_reasons (reason, description, argumentation) VALUES ('reason', 'description', 'email notice', 0) in /sites/all/modules/abuse/abuse.admin.inc on line 268.

#1

ddyrr - July 12, 2008 - 05:18

It is caused by an extra %d on line 267.

Original:

<?php
db_query
("INSERT INTO {abuse_reasons} (reason, description, argumentation) VALUES ('%s', '%s', '%s', %d)",
     
$values['short_form'], $values['description'], $values['email_notice']);
?>

Just change that line to this:

<?php
db_query
("INSERT INTO {abuse_reasons} (reason, description, argumentation) VALUES ('%s', '%s', '%s')",
     
$values['short_form'], $values['description'], $values['email_notice']);
?>

#2

skeetony - July 13, 2008 - 19:31
Status:active» closed

Thanks, works perfectly!!!

#3

BTMash - July 18, 2008 - 16:04

I've added this patch into the latest release (should be up by tomorrow). Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.