View Issue Details

IDProjectCategoryView StatusLast Update
0009971mantisbtplug-inspublic2009-01-15 11:25
Reporterbrianstv Assigned Tojreese  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit trunk 
Target Version1.2.0a3Fixed in Version1.2.0a3 
Summary0009971: InsertData in plugin schema not working as the wiki describes.
Description

Using InsertData in the plugin schema does not work as the wiki describes, and would not work until line of code in core/plugin_api.php changed.

Steps To Reproduce

The following fails:
Array( 'InsertData',
Array(db_get_table( 'mantis_config_table' ), "
(config_id, project_id, user_id, access_reqd, type, value) VALUES
('bug_resolved_status_threshold', 0, 0, 90, 1, '90')")
)

Throws the following error:
APPLICATION ERROR #2503
Upgrading the plugin schema failed in block #0.

Additional Information

If I change the code in plugin_api.php line 584
From:
'INSERT INTO ' . $t_schema[$i][0] . $t_schema[$i][1]
To:
'INSERT INTO ' . $t_schema[$i][1] . $t_schema[$i][2]

And change the schema to:
Array( 'InsertData',
db_get_table( 'mantis_config_table' ), "
(config_id, project_id, user_id, access_reqd, type, value) VALUES
('bug_resolved_status_threshold', 0, 0, 90, 1, '90')"
)

It Works.

TagsNo tags attached.

Activities

jreese

jreese

2008-12-15 12:07

reporter   ~0020374

Investigating...

jreese

jreese

2009-01-09 09:48

reporter   ~0020560

Last edited: 2009-01-09 09:49

I've committed a fix to the plugin API that properly implements the InsertData function to match both the wiki explanation and the method used in admin/schema.php:


array( "InsertData", array(
plugin_table( 'xyz' ),
"( x, y, z ) VALUES ( 'a', 'b', 'c' )"
)
)

Fix committed 1.2.x and 1.2.0a3 development trees.

Related Changesets

MantisBT: master dcde299e

2009-01-09 09:10

jreese


Details Diff
Fix 0009971: plugin schema option InsertData did not use correct schema indexes. Affected Issues
0009971
mod - core/plugin_api.php Diff File

MantisBT: master e3f68058

2009-01-09 09:10

jreese


Details Diff
Fix 0009971: plugin schema option InsertData did not use correct schema indexes. Affected Issues
0009971
mod - core/plugin_api.php Diff File