Page 1 of 1

Can't get my head around this filter issue!

Posted: 05 May 2016, 11:31
by MrZZY
My statuses are

New
Investigating
Not an issue
Fixing
Documenting
Awaiting reprint
Published

If I am on 'View Issues" in a project, and switch to another, the filter always default to hide status "Published (and above)". My understanding was that the filter defaults to the setting last used when viewing that project. This doesn't seem to be the case, I can refilter, leave the project, return to the project, and it's back to showing "Published (and above)" again. This means that to see every status I have to choose a pre-configured filter each time I switch projects, making it a two step action every time. This is a pain as I have a lot of projects (issue tracking many books).

Any idea what is going on? Or am I misunderstanding this at a basic level?

Re: Can't get my head around this filter issue!

Posted: 05 May 2016, 18:09
by aavagyan
Your 'Published' is equivalent of 'Closed'. Filter by default hides closed issues. There is $g_hide_status_default = CLOSED; setting in config, which controls this. I quickly checked filter_api.php - looks like there is no config setting to disable this feature completely. So here is my proposal. Create another status with value being more than 'Published' -> for example 200. Say 'Archived' -> something you wouldn't mind to keep hidden. Then set $g_hide_status_default to that state. Should work.

Re: Can't get my head around this filter issue!

Posted: 05 May 2016, 20:20
by MrZZY
Ah yes, that makes sense, I understand the logic. Many thanks. I'll give that a go!

Re: Can't get my head around this filter issue!

Posted: 06 May 2016, 17:27
by MrZZY
I've been working on this a while and can't quite get it to work, it's still default to published (and above).

I understand that I don't have to moved the $g_hide_status_default reference from config_defaults_inc.php as it is overidden in config_inc.php. Maybe I'm just not referencing the new status correctly, although out of desperation I tried the following:
$g_hide_status_default = ARCHIVED
$g_hide_status_default = archived
$g_hide_status_default = Archived
$g_hide_status_default = 'Archived'
$g_hide_status_default = 200

I've added the following and I can see that the new 'Archived' status is showing in mantis, but I'm still not getting $g_hide_status_default to filter on the new archived

in custom_strings_inc.php
$s_status_enum_string = '10:New,20:Investigating,30:Not an issue,50:Fixing,70:Documenting,80:Awaiting reprint,90:Published,200:Archived';

in config_inc.php
$g_status_enum_string = '10:new,20:investigating,30:notanissue,50:fixing,70:documenting,80:awaitingreprint,90:published,200:archived';
$g_hide_status_default = ARCHIVED;

Re: Can't get my head around this filter issue!

Posted: 06 May 2016, 17:59
by aavagyan
I think you did most of the right things. Indeed - don't touch $g_hide_status_default file. The following should work - just clear site cookies to be on safe side.

*********************
In config_inc.php.

$g_hide_status_default = ARCHIVED;

$g_status_colors = array(
'new' => '#fcbdbd',
'feedback' => '#e3b7eb',
'acknowledged' => '#ffcd85',
'confirmed' => '#fff494',
'assigned' => '#c2dfff',
'resolved' => '#d2f5b0',
'closed' => '#c9ccc4',
'archived' => '#cc0000');

$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed',95:archived;

*********************
Create following file in root mantis folder:
custom_constant_inc.php

<?php

define ( 'ARCHIVED', 95 );

?>

*********************
Create following file in root mantis folder:
custom_strings_inc.php

<?php
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed',95:archived;

$s_archived_bug_button = "Issue is archived";
$s_archived_bug_title = "Set Issue archived";
$s_email_notification_title_for_status_bug_archived = "The following issue is archived.";
?>

Re: Can't get my head around this filter issue!

Posted: 07 May 2016, 00:01
by MrZZY
aavagyan - thank you so much for taking the time, your last answer provided the final solution and I now have this working. I try my best with these things but I don't find them as easy! I really appreciate you taking the time to put me on the right path. :)

Re: Can't get my head around this filter issue!

Posted: 07 May 2016, 06:05
by aavagyan
You are welcome! :-)

Re: Can't get my head around this filter issue!

Posted: 17 Nov 2017, 15:38
by raymond
For what it's worth.
I was looking for a solution for the same problem, but I didn't like this one. So I did a bit more digging in filter_api.php...

My solution:
$g_hide_status_default = META_FILTER_NONE;

That's it :D

Re: Can't get my head around this filter issue!

Posted: 17 Nov 2017, 22:29
by MrZZY
raymond wrote:For what it's worth.
I was looking for a solution for the same problem, but I didn't like this one. So I did a bit more digging in filter_api.php...

My solution:
$g_hide_status_default = META_FILTER_NONE;

That's it :D
Thanks!