Advertisement:

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004190SMF 2.0Generalpublic2010-02-01 06:112010-05-09 06:13
ReporterArantor_old 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0004190: <database> not logging edits correctly if there are two <database> blocks
DescriptionWith SimpleDesk development, I created two files, install.php and install-testdata.php, to be run on install, both specified in <database> blocks. install.php uses all the correct DB functions and ordinarily it would be logged correctly.

If, however, there is a second <database> block, that doesn't trigger any DB log actions (i.e. no created tables, no created columns etc), nothing gets logged by the packman.

It's not a huge issue for SD, really, because it's test data and I only separated it out for now for practicality and we won't be doing it quite like that in the live build.

However, it's a bug that it doesn't build the complete list of changes between <database> blocks and store the final list.
TagsPackage Manager, With Fix
Attached Filespatch file icon bug_4190.patch [^] (1,980 bytes) 2010-05-06 05:32 [Show Content]

- Relationships

-  Notes
(0011867)
[SiNaN] (SMF Friend)
2010-05-06 05:32

This is because of this code, that is used to prevent the package database functions not to be loaded twice:

if (!isset($smcFunc['db_create_table']) || $smcFunc['db_create_table'] != 'db_create_table')

$smcFunc['db_create_table'] will not be 'db_create_table', but will be 'smf_db_create_table' (lacking the prefix "smf_"). So it loads the functions twice and refreshes the $db_package_log variable.

Attached a patch that:

+ fixes the issue for all database systems.
(0011899)
[SiNaN] (SMF Friend)
2010-05-09 06:13

! Package database functions were loaded more than once if initialized multiple times (DbPackages-mysql.php, DbPackages-postgresql.php, DbPackages-sqlite.php) Revision 9860
MantisBT 1.2.8 (Modified)[^] Copyright © 2000 - 2010 Mantis Group