View Issue Details

IDProjectCategoryView StatusLast Update
0013714mantisbtemailpublic2022-01-05 14:52
Reportergmajo Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.8 
Target Version1.2.9Fixed in Version1.2.9 
Summary0013714: "$g_notify_flags" config option in web config interface: problem for relationship change
Description

Setting "$g_notify_flags[relation]" array in config_inc.php doesn't properly sets flags on "E-mail on Relationship changed" in manage_config_email_page.php page; setting that option in the web page, however, produces the "$g_notify_flags[relationship]" array, and doesn't work as expected.
It seems like as if the front-end uses the keyword "relationship" while the back-end recognizes the keyword "relation".

Additional Information

My goal was to deactivate system-wide notifications on relationship changes, so I setted this config_inc.php option:
$g_notify_flags['relation'] = array('reporter' => OFF, 'handler' => OFF, 'monitor' => OFF, 'bugnotes' => OFF, 'explicit' => OFF, 'threshold_min' => NOBODY, 'threshold_max' => NOBODY);
I observed that this way the web interface doesn't changed (still check on boxes "E-mail on Relationship changed"), so I tried to change the parameter name in "$g_notify_flags[relationship]" and the interface goes as espected.
Then I started to change a lot of relationships and...my reporters were inundated with emails.
Now I setted both versions in config_inc.php ("$g_notify_flags[relation]" and "$g_notify_flags[relationship]"): in this way my reporters are quiet and the web interface looks correct, but I think it is not a good solution...

TagsNo tags attached.
Attached Files
0001-Inconsistent-definition-of-relation-g_notify_flags.patch (2,252 bytes)   
From c42cd485ec5309e639bfc9db3a63e599b113f48f Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckgroup.com>
Date: Tue, 3 Jan 2012 19:02:11 +0100
Subject: [PATCH] Inconsistent definition of 'relation' $g_notify_flags

In config_defaults_inc.php, the action for $g_notify_flags to alert
when relationships change is defined as 'relation'. This is the value
used by the email api. However, the manage_config_email_page.php used
a different value 'relationship' to store/retrieve the configuration.

This leads to inconsistent behavior: when defined in config_inc.php
with 'relation', the flags are set as expected, but not reflected in
the UI. When changed in the UI, the settings have no effect (e.g.
e-mails are sent even though the flag says they are disabled).

Fixes #13174
---
 manage_config_email_page.php |    4 ++--
 manage_config_email_set.php  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/manage_config_email_page.php b/manage_config_email_page.php
index 46063e9..2556c1e 100644
--- a/manage_config_email_page.php
+++ b/manage_config_email_page.php
@@ -193,7 +193,7 @@
 		$t_actions[] = 'sponsor';
 	}
 
-	$t_actions[] = 'relationship';
+	$t_actions[] = 'relation';
 
 	$t_statuses = MantisEnum::getAssocArrayIndexedByValues( config_get( 'status_enum_string' ) );
 	foreach( $t_statuses as $t_status ) {
@@ -263,7 +263,7 @@
 			get_capability_row_for_email( lang_get( 'email_on_sponsorship_changed' ), 'sponsor' );
 		}
 
-		get_capability_row_for_email( lang_get( 'email_on_relationship_changed' ), 'relationship' );
+		get_capability_row_for_email( lang_get( 'email_on_relationship_changed' ), 'relation' );
 
 		$t_statuses = MantisEnum::getAssocArrayIndexedByValues( config_get( 'status_enum_string' ) );
 		foreach ( $t_statuses as $t_status => $t_label ) {
diff --git a/manage_config_email_set.php b/manage_config_email_set.php
index cf9a8d4..7b273b0 100644
--- a/manage_config_email_set.php
+++ b/manage_config_email_set.php
@@ -53,7 +53,7 @@
 		$t_valid_actions[] = 'sponsor';
 	}
 
-	$t_valid_actions[] = 'relationship';
+	$t_valid_actions[] = 'relation';
 
 	$t_statuses = MantisEnum::getAssocArrayIndexedByValues( config_get( 'status_enum_string' ) );
     ksort( $t_statuses );
-- 
1.7.5.4

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0009125 closedatrol Wrong checkbox value in manage_config_email.php 

Activities

dregad

dregad

2012-01-03 13:14

developer   ~0030777

Good catch !

Please test the attached patch and let me know the results.

gmajo

gmajo

2012-01-04 03:30

reporter   ~0030779

It is a very little contrib, dregad.
Unfortunately I can't make tests because the only system where I installed MantisBT is a production environment, where I commented my config_inc-php and with the next upgrade I will delete the "$g_notify_flags[relationship]" setting.
I hope there is someone with a test environment that can make the test you asked me. I am sorry, but I can not do otherwise.

dregad

dregad

2012-01-04 06:46

developer   ~0030790

I did some testing on my side, and can confirm that the GUI now properly picks up the settings in config_inc.php and saves them under 'relation' as it should. However, my dev box does not have an operational e-mail stack so I can't test the actual notifications, but would assume that it works since the changes I made do not affect the e-mailing.

I'll commit the change as it is.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036355

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master c8a62a05

2012-01-03 05:02

dregad


Details Diff
Inconsistent definition of 'relation' $g_notify_flags

In config_defaults_inc.php, the action for $g_notify_flags to alert
when relationships change is defined as 'relation'. This is the value
used by the email api. However, the manage_config_email_page.php used
a different value 'relationship' to store/retrieve the configuration.

This leads to inconsistent behavior: when defined in config_inc.php
with 'relation', the flags are set as expected, but not reflected in
the UI. When changed in the UI, the settings have no effect (e.g.
e-mails are sent even though the flag says they are disabled).

Fixes 0013714
Affected Issues
0013714
mod - manage_config_email_page.php Diff File
mod - manage_config_email_set.php Diff File

MantisBT: master-1.2.x 909fb92e

2012-01-03 05:02

dregad


Details Diff
Inconsistent definition of 'relation' $g_notify_flags

In config_defaults_inc.php, the action for $g_notify_flags to alert
when relationships change is defined as 'relation'. This is the value
used by the email api. However, the manage_config_email_page.php used
a different value 'relationship' to store/retrieve the configuration.

This leads to inconsistent behavior: when defined in config_inc.php
with 'relation', the flags are set as expected, but not reflected in
the UI. When changed in the UI, the settings have no effect (e.g.
e-mails are sent even though the flag says they are disabled).

Fixes 0013714
Affected Issues
0013714
mod - manage_config_email_page.php Diff File
mod - manage_config_email_set.php Diff File