View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014343 | mantisbt | api soap | public | 2012-06-03 07:14 | 2014-09-23 18:05 |
Reporter | jmoloney | Assigned To | rombert | ||
Priority | urgent | Severity | block | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.10 | ||||
Target Version | 1.2.11 | Fixed in Version | 1.2.11 | ||
Summary | 0014343: Undefined property: BugnoteData::$bugnote_text_id | ||||
Description | When I try to update an Issue with the Soap API with 1.2.10 I get the following error. org.mantisbt.connect.MCException: Error Type: SYSTEM NOTICE, | ||||
Additional Information | This is important because we use the SOAP API to sync our errors from our internal bug tracking system with our partner who uses Mantis. We cannot update issues e.g. on Reopen | ||||
Tags | No tags attached. | ||||
Do you use 1.2.10 or a nightly build or latest version from github? |
|
We use v1.2.10 |
|
Are you able to reproduce the issue using http://mantisbt.mobi ? (Web interface which uses the SOAP API to connect to MantisBT) |
|
Reminder sent to: rombert any idea? |
|
There is probably a bug in bugnote_api since long time. The class BugnoteData does not contain a field 'bugnote_text_id' but this is requested in There is no problem if the bugnote cache is empty. The problem will occur if bugnote cache has been filled before by function bugnote_get_all_bugnotes. As a workaround you can comment out the lines 307-309 of function bugnote_get_field in file bugnote_api.php if( isset( $g_cache_bugnote[(int)$p_bugnote_id] ) ) {return $g_cache_bugnote[(int)$p_bugnote_id]->$p_field_name;}@jmoloney, does this fix your issue? |
|
Yes, this is solved my problem. Thanks a lot |
|
Joe, can you provide a few steps to reproduce this problem? I'd like to supply a fix. |
|
rombert, I am wondering that it took so long time that the bug appears. I am not sure what is the best performant and clean solution. The quick solution without any side effects is to change function bugnote_get_field: Another more performant approach is to cache not only the bugnote text but also the bugnote_text_id. |
|
Which kind of make sense, because bugnotes are never displayed individually (always as a full list e.g. in the bug view page).
I think this is the cleanest and easiest solution, it also would be quick to implement (just 2-3 lines of code). I also believe this is how BugnoteData should have been implemented in the first place. Maybe a slightly better option would be to cache the whole bugnote whenever any of the fields is queried, using an approach similar to what is done for BugData class. As with any caching solution however, there is a tradeoff between memory consumption and query performance, so to determine if it's worth the effort it's important to know how frequently bugnote_get_field( $p_bugnote_id, 'bugnote_text_id' ) gets called, and if it is repeatedly for the same bugnotes. If not, then it's probably not worth the effort to enforce use of the cache. |
|
That should do the trick I think (not tested)
|
|
Hi, I just tried out the patch as suggested by dregad and it worked ok for me. Cheers and keep up the good work, |
|
Based on the discussion I've implemented the fix Damien has suggested. |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master b6801844 2012-06-05 07:46 Details Diff |
Fix 0014343: Undefined property: BugnoteData::$bugnote_text_id The implementation is the one proposed by dregad |
Affected Issues 0014343 |
|
mod - core/bugnote_api.php | Diff File | ||
MantisBT: master-1.2.x 1d75494a 2012-06-05 07:46 Details Diff |
Fix 0014343: Undefined property: BugnoteData::$bugnote_text_id The implementation is the one proposed by dregad |
Affected Issues 0014343 |
|
mod - core/bugnote_api.php | Diff File |