keep_max disabled by default for existing installations (#2607)

Fix https://github.com/FreshRSS/FreshRSS/issues/2600
Second attempt https://github.com/FreshRSS/FreshRSS/pull/2602
pull/2610/head
Alexandre Alapetite 5 years ago committed by GitHub
parent 571fb31af8
commit e4511c3d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/Models/Context.php

@ -54,14 +54,13 @@ class FreshRSS_Context {
//Legacy
$oldEntries = (int)FreshRSS_Context::$user_conf->param('old_entries', 0);
if ($oldEntries > 0) { //Freshrss < 1.15
$archiving['keep_period'] = 'P' . $oldEntries . 'M';
}
$keepMin = (int)FreshRSS_Context::$user_conf->param('keep_history_default', -5);
if ($keepMin > -5) { //Freshrss < 1.15
if ($oldEntries > 0 || $keepMin > -5) { //Freshrss < 1.15
$archiving = FreshRSS_Context::$user_conf->archiving;
$archiving['keep_max'] = false;
if ($oldEntries > 0) {
$archiving['keep_period'] = 'P' . $oldEntries . 'M';
}
if ($keepMin > 0) {
$archiving['keep_min'] = $keepMin;
} elseif ($keepMin == -1) { //Infinite

Loading…
Cancel
Save