View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004154 | mantisbt | bugtracker | public | 2004-07-21 01:57 | 2004-08-29 02:35 |
Reporter | OverloadUT | Assigned To | vboctor | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.19.0a2 | ||||
Fixed in Version | 0.19.0rc1 | ||||
Summary | 0004154: "Product version" and "Fixed in Version" do not get updated on rename | ||||
Description | When you rename a version on the Manage page, any bugs that are listed as being from that version do not get updated to the renamed, nor do any bugs that have that version as its "Fixed in Version." It makes renaming versions the same as deleting the old version and creating a new one, which isn't what it should do. (IMHO) | ||||
Additional Information | We like put the date the release was made available to testers in the name, but we don't know that until it becomes a released build. But if we rename it, all the bugs no longer link to that version. | ||||
Tags | No tags attached. | ||||
Attached Files | version_rename_bug.diff (1,128 bytes)
Index: core/version_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/version_api.php,v retrieving revision 1.17 diff -u -r1.17 version_api.php --- core/version_api.php 11 Jul 2004 07:09:52 -0000 1.17 +++ core/version_api.php 21 Jul 2004 21:59:01 -0000 @@ -137,7 +137,7 @@ # check for duplicates if ( ( strtolower( $t_old_version_name ) != strtolower( $p_version_info->version ) ) && - !version_is_unique( $p_version_info->version, $p_project_id ) ) { + !version_is_unique( $p_version_info->version, $p_version_info->project_id ) ) { trigger_error( ERROR_VERSION_DUPLICATE, ERROR ); } @@ -147,6 +147,7 @@ $c_description = db_prepare_string( $p_version_info->description ); $c_released = db_prepare_int( $p_version_info->released ); $c_date_order = db_prepare_string( $p_version_info->date_order ); + $c_project_id = db_prepare_int( $p_version_info->project_id ); $t_project_version_table = config_get( 'mantis_project_version_table' ); $t_bug_table = config_get( 'mantis_bug_table' ); | ||||
The intention is that when a version is renamed, all issues associated with it through product version or fixed in release should be updated as well. If that's not happening, then it needs to be fixed. |
|
Okay I figured out the bug and fixed it in my version. version_api.php, in the version_update() function, $p_project_id and $c_project_id never get set. So when it goes to do the database query, it does "WHERE ( project_id='' )" which does nothing, but does not throw and error. I fixed it by: |
|
Ack! That change made it always report project_id to be 1. This is what 137 SHOULD be: Line 137: $p_project_id = version_get_field( $p_version_info->id, 'project_id' ); |
|
I attached a patch with minor changes compared to your proposed solution. |
|