View Issue Details

IDProjectCategoryView StatusLast Update
0023657mantisbtapi soappublic2017-12-04 02:17
ReportermantisiatorAssigned Toatrol 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.8.0 
Target Version2.9.0Fixed in Version2.9.0 
Summary0023657: mc_issue_update returns bug is read only on status update
Description

Hi all,
I have met the follwing problem when using the mc_issue_update() function:

When updating an issue status:

  • using a user account and the mantis HMI, the issue status is updated properly,
  • using the mc_issue_update function, a message indicating that the issue is readonly is returned.

For information, the problem does not happen with an admin account.

Extract of the xml file called via curl :

?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<mc_issue_update xmlns="http://rts-int.eurocontrol.fr/api/soap/mantisconnect/"><username>XXXX</username><password>YYYY</password>
<issueId>8301</issueId>
<issue>
<project><id>11</id></project>
<description> This is my description.</description>
<summary>0008301: This is my summary</summary>
<status><name>fixed</name></status>
</issue>
</mc_issue_update></soap:Body></soap:Envelope>

TagsNo tags attached.

Relationships

related to 0022552 new mc_issue_update doesn't honor project "resolved/read only" settings, adjusted threshholds, or "allow reporters to reopen" 

Activities

mantisiator

mantisiator

2017-11-21 06:18

reporter   ~0058230

Hi,

The problem thatI see while debuggins that while calling the function via the SOAP api, the bug_is_readonly always returns true, since referring to the global parameters g_bug_readonly_status_threshold set to 80 (RESOLVED) and g_update_readonly_bug_threshold set to Manager.

Question: How can this fuction call refer to the project specfic values of these parameters (which are taken into account when called via the Web interface and visibly not via the soap API.

Thank you very much for your help !

function bug_is_readonly( $p_bug_id ) {
$t_status = bug_get_field( $p_bug_id, 'status' );
if( $t_status < config_get( 'bug_readonly_status_threshold' ) ) {
return false;
}

    if( access_has_bug_level( config_get( 'update_readonly_bug_threshold' ), $p_bug_id ) ) {
            return false;
    }

    return true;

}

atrol

atrol

2017-11-21 07:15

developer   ~0058231

Changing function bug_is_readonly
from

    if( $t_status < config_get( 'bug_readonly_status_threshold' ) ) {

to

    if( $t_status < config_get( 'bug_readonly_status_threshold', null, null, bug_get_field( $p_bug_id, 'project_id' ) ) ) {

should fix the issue.

mantisiator

mantisiator

2017-11-21 07:48

reporter   ~0058233

Hi atrol,
I just wanted to suggest you this change..:) since I saw it in bug_change_status_page.php
Do you think this will have a regression on other functionalities since the bug_is_readonly is used in several locations ?
If not, do you think it will be merged in 2.8.1 + versions?

Thanks a lot in advance !

atrol

atrol

2017-11-22 03:03

developer   ~0058236

PR https://github.com/mantisbt/mantisbt/pull/1244

atrol

atrol

2017-11-22 03:09

developer   ~0058237

Do you think this will have a regression on other functionalities since the bug_is_readonly is used in several locations ?

We might uncover other bugs after this bug is fixed.

If not, do you think it will be merged in 2.8.1 + versions?

Let's wait for the PR feedback of other devs.
According our rules it would be part of 2.9.0 as this seems to be a quite old bug, but not a regression.

Related Changesets

MantisBT: master 8fbf5e59

2017-11-22 02:59:42

atrol


Committer: vboctor Details Diff
Correct access checks for readonly issues

Fixes 0023657
mod - core/bug_api.php Diff File

Issue History

Date Modified Username Field Change
2017-11-20 10:01 mantisiator New Issue
2017-11-21 06:18 mantisiator Note Added: 0058230
2017-11-21 07:15 atrol Note Added: 0058231
2017-11-21 07:22 atrol Relationship added related to 0022552
2017-11-21 07:48 mantisiator Note Added: 0058233
2017-11-22 03:03 atrol Assigned To => atrol
2017-11-22 03:03 atrol Status new => assigned
2017-11-22 03:03 atrol Target Version => 2.9.0
2017-11-22 03:03 atrol Note Added: 0058236
2017-11-22 03:09 atrol Note Added: 0058237
2017-11-28 12:10 vboctor Changeset attached => MantisBT master 8fbf5e59
2017-11-28 12:10 atrol Status assigned => resolved
2017-11-28 12:10 atrol Resolution open => fixed
2017-11-28 12:10 atrol Fixed in Version => 2.9.0
2017-12-04 02:17 vboctor Status resolved => closed