Can't get my head around this filter issue!

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
MrZZY
Posts: 13
Joined: 08 Feb 2015, 20:06

Can't get my head around this filter issue!

Post 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?
Attachments
Screenshot 2016-05-05 12.28.59.png
Screenshot 2016-05-05 12.28.59.png (13.71 KiB) Viewed 9890 times
aavagyan
Posts: 84
Joined: 08 Dec 2013, 14:23
Location: Germany
Contact:

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

Post 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.
Mantis Statistics Plugin: https://www.mantisstats.org
MrZZY
Posts: 13
Joined: 08 Feb 2015, 20:06

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

Post by MrZZY »

Ah yes, that makes sense, I understand the logic. Many thanks. I'll give that a go!
MrZZY
Posts: 13
Joined: 08 Feb 2015, 20:06

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

Post 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;
aavagyan
Posts: 84
Joined: 08 Dec 2013, 14:23
Location: Germany
Contact:

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

Post 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.";
?>
Mantis Statistics Plugin: https://www.mantisstats.org
MrZZY
Posts: 13
Joined: 08 Feb 2015, 20:06

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

Post 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. :)
aavagyan
Posts: 84
Joined: 08 Dec 2013, 14:23
Location: Germany
Contact:

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

Post by aavagyan »

You are welcome! :-)
Mantis Statistics Plugin: https://www.mantisstats.org
raymond
Posts: 4
Joined: 04 Aug 2017, 11:24

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

Post 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
MrZZY
Posts: 13
Joined: 08 Feb 2015, 20:06

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

Post 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!
Post Reply