🤖 Auto commit for release 'develop' on 2025-08-16

This commit is contained in:
JC5
2025-08-16 19:36:45 +02:00
parent eccc58e75a
commit 3409240a19
22 changed files with 96 additions and 73 deletions

View File

@@ -47,7 +47,7 @@ class AccountController extends Controller
use CleansChartData;
use CollectsAccountsFromFilter;
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
private array $chartData = [];
private AccountRepositoryInterface $repository;

View File

@@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DateRequest;
use FireflyIII\Api\V1\Requests\Data\SameDateRequest;
use FireflyIII\Enums\UserRoleEnum;
use FireflyIII\Exceptions\FireflyException;

View File

@@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DateRequest;
use FireflyIII\Api\V1\Requests\Data\SameDateRequest;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;

View File

@@ -46,6 +46,7 @@ use Illuminate\Http\JsonResponse;
class PurgeController extends Controller
{
protected array $acceptedRoles = [UserRoleEnum::FULL];
public function __construct()
{
parent::__construct();

View File

@@ -42,7 +42,7 @@ class ValidatesEnvironmentVariables extends Command
*
* @var string
*/
protected $signature = 'integrity:validates-environment-variables';
protected $signature = 'integrity:validates-environment-variables';
/**
* Execute the console command.
@@ -67,9 +67,9 @@ class ValidatesEnvironmentVariables extends Command
private function validateLanguage(): bool
{
$language = config('firefly.default_language');
$locale = config('firefly.default_locale');
$options = array_keys(config('firefly.languages'));
$language = config('firefly.default_language');
$locale = config('firefly.default_locale');
$options = array_keys(config('firefly.languages'));
if (!in_array($language, $options, true)) {
$this->friendlyError(sprintf('DEFAULT_LANGUAGE "%s" is not a valid language for Firefly III.', $language));
@@ -86,6 +86,7 @@ class ValidatesEnvironmentVariables extends Command
return false;
}
return true;
}
@@ -96,8 +97,10 @@ class ValidatesEnvironmentVariables extends Command
$this->friendlyError(sprintf('AUTHENTICATION_GUARD "%s" is not a valid guard for Firefly III.', $guard));
$this->friendlyError('Please check your .env file and make sure you use a valid setting.');
$this->friendlyError('Valid guards are: web, remote_user_guard');
return false;
}
return true;
}
@@ -107,8 +110,10 @@ class ValidatesEnvironmentVariables extends Command
if ('' !== $token && 32 !== strlen($token)) {
$this->friendlyError('STATIC_CRON_TOKEN must be empty or a 32-character string.');
$this->friendlyError('Please check your .env file and make sure you use a valid setting.');
return false;
}
return true;
}
}

View File

@@ -34,6 +34,7 @@ use Illuminate\Support\Facades\Storage;
use Safe\Exceptions\FileinfoException;
use Safe\Exceptions\FilesystemException;
use Safe\Exceptions\StringsException;
use function Safe\file_put_contents;
use function Safe\md5_file;
use function Safe\mime_content_type;
@@ -45,10 +46,11 @@ class ScansAttachments extends Command
protected $description = 'Rescan all attachments and re-set the correct MD5 hash and mime.';
protected $signature = 'firefly-iii:scan-attachments';
protected $signature = 'firefly-iii:scan-attachments';
/**
* Execute the console command.
*
* @throws FilesystemException
* @throws StringsException
* @throws FileinfoException
@@ -74,7 +76,7 @@ class ScansAttachments extends Command
Log::error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
$decryptedContent = $encryptedContent;
}
$tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII');
$tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII');
file_put_contents($tempFileName, $decryptedContent);
$attachment->md5 = (string)md5_file($tempFileName);
$attachment->mime = (string)mime_content_type($tempFileName);

View File

@@ -835,8 +835,10 @@ class GroupCollector implements GroupCollectorInterface
if (count($product['transactions']) > 1) {
return $product['title'];
}
return 'zzz';
}
return 'zzz';
});
}

View File

@@ -66,16 +66,16 @@ class FrontpageChartGenerator
public function generate(): array
{
Log::debug(sprintf('Now in %s', __METHOD__));
$categories = $this->repository->getCategories();
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]);
$collection = $this->collectExpensesAll($categories, $accounts);
$categories = $this->repository->getCategories();
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value]);
$collection = $this->collectExpensesAll($categories, $accounts);
// collect for no-category:
$noCategory = $this->collectNoCatExpenses($accounts);
$collection = array_merge($collection, $noCategory);
$noCategory = $this->collectNoCatExpenses($accounts);
$collection = array_merge($collection, $noCategory);
// sort temp array by amount.
$amounts = array_column($collection, 'sum_float');
$amounts = array_column($collection, 'sum_float');
array_multisort($amounts, SORT_ASC, $collection);
$currencyData = $this->createCurrencyGroups($collection);
@@ -168,6 +168,7 @@ class FrontpageChartGenerator
];
}
}
return $tempData;
}
}

View File

@@ -74,7 +74,7 @@ class User extends Authenticatable
use HasApiTokens;
use Notifiable;
use ReturnsIntegerIdTrait;
protected $fillable = ['email', 'password', 'blocked', 'blocked_code','user_group_id'];
protected $fillable = ['email', 'password', 'blocked', 'blocked_code', 'user_group_id'];
protected $hidden = ['password', 'remember_token'];
protected $table = 'users';