SQL errors when changing settings or running a scan

detour - October 15, 2009 - 16:38
Project:Search and Replace Scanner
Version:5.x-2.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

When I tried changing and saving the settings for the Scanner, I ran into SQL errors about a duplicate value in the name field of the variable table.

I tracked this problem down to how the Scanner saves its configuration settings: The variables table limits the name field to 48 characters, but the Scanner may overrun this limit because it generates names based on concatenating several values together (the field, table, and type names of the CCK/node fields).

I fixed this problem by reworking the code for saving and retrieving the settings so that the fields-to-scan are consolidated in a single variable (with a name of a valid length).

Hope this helps others. It's a very useful module.

AttachmentSize
scanner-consolidate_variables.diff3.39 KB
 
 

Drupal is a registered trademark of Dries Buytaert.