largersmallernormaltext version of this page

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0010828 [phplist] Template Management major always 30-07-07 09:05 18-02-08 14:08
Reporter sniffi View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 2.10.4
Summary 0010828: Possible faulty insert; Database error 1062 while doing query Duplicate entry 'Untitled Template' for key 2
Description When inserting a template with the name "Untitled Template" or when inserting a template fails for some reason you must manually delete the "untitled template" from the template list.
This is caused in admin/template.php:

    if (!$id) {
      Sql_Query("insert into {$tables["template"]} (title) values(\"Untitled Template\")");
      $id = Sql_Insert_id();
    }
    Sql_Query(sprintf('update %s set title = "%s",template = "%s" where id = %d',
       $tables["template"],$title,addslashes($content),$id));

Why not insert with the right title in the first place? i guess it's related to editing or something. maybe its easier to just not mark the title field as unique, and check uniqueness manually
Additional Information
Tags No tags attached.
Attached Files

- Relationships
related to 0003721closed phplist 2.10.x 

-  Notes
(0030815)
bas (developer)
21-08-07 19:26

When adding a template with an existing name this generates an 1062 error and the 'Untitled Template' tupel appears.

Changed temporary name to the $title field, which solves this issue.


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker