View Issue Details

IDProjectCategoryView StatusLast Update
0019984mantisbtlocalizationpublic2015-09-06 17:37
Reporterbadfiles Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0-beta.2 
Target Version1.3.0-beta.3Fixed in Version1.3.0-beta.3 
Summary0019984: Hardcoded strings in bug_update.php and bug_api.php
Description

bug_update.php contains
email_generic( $f_bug_id, 'resolved', 'The following issue has been RESOLVED.' );
email_generic( $f_bug_id, 'closed', 'The following issue has been CLOSED' );

core/bug_api.php contains
email_generic( $p_bug_id, 'closed', 'The following issue has been CLOSED' );
email_generic( $p_bug_id, 'resolved', 'The following issue has been RESOLVED.' );

It breaks localization.

TagsNo tags attached.

Activities

atrol

atrol

2015-07-29 10:23

developer   ~0051148

Regression introduced by commit 03c5a5d

dregad

dregad

2015-08-02 17:06

developer   ~0051172

This is not really a regression IMO - the hardcoded values where there before the mentioned commit (but encapsulated within email api).

It's worth mentioning that these values are not actual issue status codes, just arbitrary strings used to determine the behavior of the email notification process.

That being said, it would indeed be cleaner to replace these by constants.

atrol

atrol

2015-08-02 17:22

developer   ~0051174

It is a regression as the existing hard coded strings have been replaced by new hardcoded strings that can't be localized
e.g.
'email_notification_title_for_status_bug_resolved'
has been replaced by
'The following issue has been RESOLVED.'

There is a string $s_email_notification_title_for_status_bug_resolved
but none for the new wrong string.

dregad

dregad

2015-08-02 18:32

developer   ~0051184

Ah sorry I was not paying close enough attention and misunderstood the issue... I thought you were referring to the 'resolved' and 'closed' constants.

dregad

dregad

2015-08-02 18:43

developer   ~0051185

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

vboctor

vboctor

2015-08-05 01:25

manager   ~0051201

Another proposed PR https://github.com/mantisbt/mantisbt/pull/626

Related Changesets

MantisBT: master 03c5a5d1

2014-01-13 07:30

Paul Richards


Details Diff
Replace email_* calls with raw email_generic calls. This is to try and make a shorter patchset in a bit ;) Affected Issues
0019984
mod - api/soap/mc_issue_api.php Diff File
mod - bug_report.php Diff File
mod - bug_update.php Diff File
mod - core/bug_api.php Diff File
mod - core/bugnote_api.php Diff File
mod - core/email_api.php Diff File
mod - core/sponsorship_api.php Diff File

MantisBT: master 8193ac33

2015-08-04 19:57

vboctor


Details Diff
Revert email_* calls to not use generic API

It is undesirable to use this approach for the following:
- Having each caller having to know the right language string + call type.
- Having a properly named APIs provides better intelli-sense experience.
- It is easier to add event spent logic or extra parameters compared to switch statements in generic API.
- More inline with the approach of having different email formats based on the change event, rather than a single format which dumps the whole issue, rather than focus on the actual change.

Fixes 0019984

This reverts commit 03c5a5d18cfef07dec45a1025072981f24a5f07c.

Conflicts:
- bug_update.php
- core/bugnote_api.php
- library/disposable
- library/ezc/Base
- library/ezc/Graph
- library/securimage
Affected Issues
0019984
mod - api/soap/mc_issue_api.php Diff File
mod - bug_report.php Diff File
mod - bug_update.php Diff File
mod - core/bug_api.php Diff File
mod - core/bugnote_api.php Diff File
mod - core/email_api.php Diff File
mod - core/sponsorship_api.php Diff File