mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix #10871
This commit is contained in:
@@ -94,7 +94,7 @@ trait AttachmentCollection
|
|||||||
static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
|
||||||
$q1->where('attachments.attachable_type', TransactionJournal::class);
|
$q1->where('attachments.attachable_type', TransactionJournal::class);
|
||||||
// $q1->where('attachments.uploaded', true);
|
// $q1->where('attachments.uploaded', true);
|
||||||
$q1->whereNull('attachments.deleted_at');
|
// $q1->whereNull('attachments.deleted_at');
|
||||||
$q1->orWhereNull('attachments.attachable_type');
|
$q1->orWhereNull('attachments.attachable_type');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -107,6 +107,7 @@ trait AttachmentCollection
|
|||||||
$this->fields[] = 'attachments.id as attachment_id';
|
$this->fields[] = 'attachments.id as attachment_id';
|
||||||
$this->fields[] = 'attachments.filename as attachment_filename';
|
$this->fields[] = 'attachments.filename as attachment_filename';
|
||||||
$this->fields[] = 'attachments.title as attachment_title';
|
$this->fields[] = 'attachments.title as attachment_title';
|
||||||
|
$this->fields[] = 'attachments.deleted_at as attachment_deleted_at';
|
||||||
$this->fields[] = 'attachments.uploaded as attachment_uploaded';
|
$this->fields[] = 'attachments.uploaded as attachment_uploaded';
|
||||||
$this->joinAttachmentTables();
|
$this->joinAttachmentTables();
|
||||||
|
|
||||||
|
@@ -634,7 +634,8 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
if (array_key_exists('attachment_id', $result) && null !== $result['attachment_id']) {
|
if (array_key_exists('attachment_id', $result) && null !== $result['attachment_id']) {
|
||||||
$uploaded = 1 === (int)$result['attachment_uploaded'];
|
$uploaded = 1 === (int)$result['attachment_uploaded'];
|
||||||
$attachmentId = (int)$augumentedJournal['attachment_id'];
|
$attachmentId = (int)$augumentedJournal['attachment_id'];
|
||||||
if (0 !== $attachmentId && $uploaded) {
|
$deleted = null !== $result['attachment_deleted_at'];
|
||||||
|
if (0 !== $attachmentId && $uploaded && !$deleted) {
|
||||||
$result['attachments'][$attachmentId] = [
|
$result['attachments'][$attachmentId] = [
|
||||||
'id' => $attachmentId,
|
'id' => $attachmentId,
|
||||||
'filename' => $augumentedJournal['attachment_filename'],
|
'filename' => $augumentedJournal['attachment_filename'],
|
||||||
|
Reference in New Issue
Block a user