View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012112 | mantisbt | plug-ins | public | 2010-06-24 11:59 | 2014-09-23 18:05 |
Reporter | docteur.cox | Assigned To | dregad | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.1 | ||||
Target Version | 1.2.12 | Fixed in Version | 1.2.12 | ||
Summary | 0012112: XML Import fails: Column 'profile_id' cannot be null | ||||
Description | XML import fails with the following error message : Échec de la requête de base de données. L'erreur renvoyée par la base de données était #1048 : Column 'profile_id' cannot be null pour la requête : INSERT INTO mantis_bug_table | ||||
Tags | custom fields, summary | ||||
Export function does not include any profile information in the exported data. |
|
I can confirm that. This bug is a duplicate of bug 0012123, by the way. |
|
Can someone check if the latest nightly snapshot of MantisBT 1.3.x resolves this issue? Issue 0012013 improved the XML import/export functionality a great deal. Thanks |
|
I installed the current nightly build to test that, but I can't login into this build: APPLICATION ERROR #2900 I cannot find a solution for that. Can someone help me? Than I can test the new Im-/Export. |
|
The latest version of the manual contains information on how to set $g_crypto_master_salt. Basically just set it to a completely random string (20+ characters) inside config_defaults_inc.pgp |
|
This only occurs to issues that contain the value 0 (zero) in the "profile_id" field. If the field has a different value, it is exported. The problem is the following code in plugins/XMLImportExport/export.php : The empty() function returns FALSE, if the field's value is 0 (zero). This is an excerpt of the PHP manual, empty() function: The following things are considered to be empty:
[/excerpt] Thus, variables containing 0 (zero) are considered empty. This might also be a problem for other fields containing 0 (zero) values. I modified the code above to: [code] and it seems to work, I can not say if there are other problems with this code, though. |
|
It seems that the exporter is currently designed not to export properties that have empty/null values. Thus the importer should be detecting missing fields in the XML file and filling them with default values (taking into account the defaults set in config_defaults_inc.php). Thus I think the fixes need to be made to the import side of the plugin to resolve this issue? |
|
I stumbled upon this problem, and looked into the DB I found all my issues have "profile_id" 0, so I just did "alter table mantis_bug_table change column profile_id profile_id int(7) unsigned default 0;" and the import worked fine. |
|
This was already fixed in master as part of 0012013 |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x cb825352 2012-09-18 01:51 Details Diff |
XmlImportExport: Fix import error "Column 'profile_id' cannot be null" In bug_api.php BugData class, the profile_id member variable defaults to null but the DB bug table does not allow null values, causing the error. Defaulting the variable to 0 resolves the problem. Fixes 0012112 |
Affected Issues 0012112 |
|
mod - core/bug_api.php | Diff File |