phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010828phplist applicationTemplate Managementpublic30-07-07 10:0518-02-08 14:08
Reportersniffi 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version2.10.4 
Target Version2.10.7Fixed in Version2.10.5 
Summary0010828: Possible faulty insert; Database error 1062 while doing query Duplicate entry 'Untitled Template' for key 2
DescriptionWhen 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
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to 0003721closed phplist 2.10.x 

-  Notes
(0030815)
user1822
21-08-07 20: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.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker