Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8233 now.

warning duration of '0' removes warning (fix completed in vcs)

If I set my warning duration to '0' in the ACP, the warning is automatically removed after a few hours. I dont know if this is by design, but I would think that there should be a way to have warnings be permanent until I remove them manually (I have a script that I use to do that).

Comments / History

Posted by A_O_C on Mar 27th 2009, 15:22

Just thought I would update this. The code below fixes the problem. Whether it is a bug or not is, of course, up to you.

Code: Select all
OPEN:
includes/functions.php

FIND:
      else if (time() - $config['warnings_gc'] > $config['warnings_last_gc'])
      {
         $cron_type = 'tidy_warnings';
      }

REPLACE WITH:
      else if (time() - $config['warnings_gc'] > $config['warnings_last_gc'])
      {
         if ($config['warnings_expire_days'] == 0)
         {
            $cron_type = '';
         }
         else
         {
            $cron_type = 'tidy_warnings';
         }
      }

Posted by nickvergessen (Development Team Member) on Mar 27th 2009, 16:02

Or simply:
Code: Select all
      else if ((time() - $config['warnings_gc'] > $config['warnings_last_gc']) && $config['warnings_expire_days'])
      {
         $cron_type = 'tidy_warnings';
      }

Posted by Acyd Burn (Server Manager) on Jun 19th 2009, 17:23

A good change for 3.0.6 may be now to extend warnings a bit and allow it's removal. :/ There should be another ticket somewhere about this... but i seem to be not able to find it.

Assigned ticket to user "nickvergessen"

Action performed by Acyd Burn (Server Manager) on Jun 19th 2009, 17:23

Changed ticket status from "New" to "Fix in progress"

Action performed by nickvergessen (Development Team Member) on Jun 21st 2009, 22:00

Posted by A_O_C on Jun 25th 2009, 18:31

I just saw this... :D



Acyd Burn wrote:A good change for 3.0.6 may be now to extend warnings a bit and allow it's removal.

I agree. It would still be nice if a setting of "0" was permanent though.

Nickvergessen, I haven't tested your solution, but wouldn't $config['warning_expire_days'] still be defined if it was 0? That would mean tidy_warnings would still run, putting us right back to square 1. Maybe add > 0 to before the ).

Edited post #165835

Action performed by A_O_C on Jun 25th 2009, 18:32

Posted by nickvergessen (Development Team Member) on Jun 25th 2009, 19:32

it is defined yes, but I didn't check for being defined, but whether the value is something or is 0

Linked ticket with changeset: r9758

Action performed by nickvergessen (Development Team Member) on Jul 14th 2009, 20:35

Changed ticket status from "Fix in progress" to "Fix completed in SVN"

Action performed by nickvergessen (Development Team Member) on Jul 14th 2009, 20:38

Linked ticket with changesets: r9828

Action performed by nickvergessen (Development Team Member) on Jul 22nd 2009, 11:48

Ticket details

Related SVN changesets