Update code

This commit is contained in:
James Cole
2024-02-14 19:47:35 +01:00
parent ac17b82d85
commit 7897ebc4d5
6 changed files with 49 additions and 48 deletions

View File

@@ -680,16 +680,16 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.28.0", "version": "v1.29.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -703,9 +703,6 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "url": "https://github.com/symfony/polyfill"
@@ -742,7 +739,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
}, },
"funding": [ "funding": [
{ {
@@ -758,20 +755,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-01-26T09:26:14+00:00" "time": "2024-01-29T20:11:03+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.28.0", "version": "v1.29.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "42292d99c55abe617799667f454222c54c60e229" "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"reference": "42292d99c55abe617799667f454222c54c60e229", "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -785,9 +782,6 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "url": "https://github.com/symfony/polyfill"
@@ -825,7 +819,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
}, },
"funding": [ "funding": [
{ {
@@ -841,7 +835,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-07-28T09:04:16+00:00" "time": "2024-01-29T20:11:03+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",

View File

@@ -60,11 +60,8 @@ class TransactionController extends Controller
$collector->setEnd($end); $collector->setEnd($end);
} }
// $collector->dumpQuery();
// exit;
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$params = $request->buildParams($pageSize); $params = $request->buildParams();
$paginator->setPath( $paginator->setPath(
sprintf( sprintf(
'%s?%s', '%s?%s',
@@ -119,6 +116,7 @@ class TransactionController extends Controller
return response() return response()
->json($this->jsonApiList('transactions', $paginator, new TransactionGroupTransformer())) ->json($this->jsonApiList('transactions', $paginator, new TransactionGroupTransformer()))
->header('Content-Type', self::CONTENT_TYPE); ->header('Content-Type', self::CONTENT_TYPE)
;
} }
} }

View File

@@ -28,8 +28,8 @@ use FireflyIII\Events\Model\Rule\RuleActionFailedOnArray;
use FireflyIII\Events\Model\Rule\RuleActionFailedOnObject; use FireflyIII\Events\Model\Rule\RuleActionFailedOnObject;
use FireflyIII\Notifications\User\RuleActionFailed; use FireflyIII\Notifications\User\RuleActionFailed;
use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ClientException;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Log;
/** /**
* Class RuleHandler * Class RuleHandler
@@ -57,6 +57,7 @@ class RuleHandler
$ruleTitle = $rule->title; $ruleTitle = $rule->title;
$ruleLink = route('rules.edit', [$rule->id]); $ruleLink = route('rules.edit', [$rule->id]);
$params = [$mainMessage, $groupTitle, $groupLink, $ruleTitle, $ruleLink]; $params = [$mainMessage, $groupTitle, $groupLink, $ruleTitle, $ruleLink];
try { try {
Notification::send($user, new RuleActionFailed($params)); Notification::send($user, new RuleActionFailed($params));
} catch(ClientException $e) { } catch(ClientException $e) {
@@ -85,6 +86,7 @@ class RuleHandler
$ruleTitle = $rule->title; $ruleTitle = $rule->title;
$ruleLink = route('rules.edit', [$rule->id]); $ruleLink = route('rules.edit', [$rule->id]);
$params = [$mainMessage, $groupTitle, $groupLink, $ruleTitle, $ruleLink]; $params = [$mainMessage, $groupTitle, $groupLink, $ruleTitle, $ruleLink];
try { try {
Notification::send($user, new RuleActionFailed($params)); Notification::send($user, new RuleActionFailed($params));
} catch(ClientException $e) { } catch(ClientException $e) {

View File

@@ -477,7 +477,7 @@ class GroupCollector implements GroupCollectorInterface
} }
// OR filter the array according to the start and end row variable // OR filter the array according to the start and end row variable
if (null !== $this->startRow && null !== $this->endRow) { if (null !== $this->startRow && null !== $this->endRow) {
return $collection->slice((int)$this->startRow, (int)$this->endRow); return $collection->slice($this->startRow, $this->endRow);
} }
return $collection; return $collection;
@@ -493,7 +493,7 @@ class GroupCollector implements GroupCollectorInterface
$this->setLimit(50); $this->setLimit(50);
} }
if(null !== $this->startRow && null !== $this->endRow) { if(null !== $this->startRow && null !== $this->endRow) {
$total = (int)($this->endRow - $this->startRow); $total = $this->endRow - $this->startRow;
return new LengthAwarePaginator($set, $this->total, $total, 1); return new LengthAwarePaginator($set, $this->total, $total, 1);
} }

View File

@@ -129,13 +129,17 @@ class UpdateRequest implements UpdateRequestInterface
return $return; return $return;
} }
/**
* TODO make shorter
*
* @param array $information
*
* @return array
*/
private function parseResult(array $information): array private function parseResult(array $information): array
{ {
app('log')->debug('Now in parseResult()', $information); app('log')->debug('Now in parseResult()', $information);
$return = [ $return = [];
'level' => 'error',
'message' => (string)trans('firefly.unknown_error'),
];
$current = config('firefly.version'); $current = config('firefly.version');
$latest = $information['version']; $latest = $information['version'];
@@ -146,17 +150,20 @@ class UpdateRequest implements UpdateRequestInterface
if (str_starts_with($current, 'develop')) { if (str_starts_with($current, 'develop')) {
Log::debug(sprintf('User is running develop version "%s"', $current)); Log::debug(sprintf('User is running develop version "%s"', $current));
$parts = explode('/', $current); $parts = explode('/', $current);
/** @var Carbon $devDate */
$devDate = Carbon::createFromFormat('Y-m-d', $parts[1]); $devDate = Carbon::createFromFormat('Y-m-d', $parts[1]);
if ($devDate->lte($information['date'])) { if ($devDate->lte($information['date'])) {
Log::debug(sprintf('This development release is older, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); Log::debug(sprintf('This development release is older, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d')));
$return['level'] = 'info'; $return['level'] = 'info';
$return['message'] = (string)trans('firefly.update_current_dev_older', ['version' => $current, 'new_version' => $latest]); $return['message'] = (string)trans('firefly.update_current_dev_older', ['version' => $current, 'new_version' => $latest]);
return $return; return $return;
} }
Log::debug(sprintf('This development release is newer, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); Log::debug(sprintf('This development release is newer, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d')));
$return['level'] = 'info'; $return['level'] = 'info';
$return['message'] = (string)trans('firefly.update_current_dev_newer', ['version' => $current, 'new_version' => $latest]); $return['message'] = (string)trans('firefly.update_current_dev_newer', ['version' => $current, 'new_version' => $latest]);
return $return; return $return;
} }