Skip to content

Commit b428852

Browse files
author
Jordi Puigdellívol
committed
Fixes replying from handesk with only attachment
1 parent 7ac19ed commit b428852

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

app/Http/Controllers/CommentsController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ class CommentsController extends Controller
1010
public function store(Ticket $ticket)
1111
{
1212
$this->authorize('view', $ticket);
13+
1314
if (request('private')) {
1415
$comment = $ticket->addNote(auth()->user(), request('body'));
1516
} else {
1617
$comment = $ticket->addComment(auth()->user(), request('body'), request('new_status'));
1718
}
18-
if (request()->hasFile('attachment')) {
19+
if ($comment && request()->hasFile('attachment')) {
1920
Attachment::storeAttachmentFromRequest(request(), $comment);
2021
}
2122

app/Jobs/EmailParsers/NewCommentEmailParser.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ public function handle($message)
1414
if (! $ticket) {
1515
return false;
1616
}
17-
$comment = $ticket->addComment($messageParser->getUser($ticket),
18-
$messageParser->getCommentBody());
17+
$comment = $ticket->addComment(
18+
$messageParser->getUser($ticket),
19+
$messageParser->getCommentBody()
20+
);
1921
Attachment::storeAttachmentsFromEmail($message, $comment);
2022

2123
return true;

database/seeds/DatabaseSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function run()
1717
{
1818
// $this->call(UsersTableSeeder::class);
1919
factory(User::class)->create([
20-
'email' => 'admin@handesk.com',
20+
'email' => 'admin@handesk.io',
2121
'password' => bcrypt('admin'),
2222
'admin' => true,
2323
]);

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ php artisan storage:link #if you use the local driver
4646
Alternatively, you can use the following [docker setup](https://github.com/BadChoice/handesk/blob/dev/docker-installation.md)
4747

4848

49-
> The default admin user is admin@handesk.com / admin
49+
> The default admin user is admin@handesk.io / admin
5050
> If you want email pulling, you need to enable the `imap` extension on php (note that on mac the php-cli runs very slow, you need to update your /etc/hosts file
5151
5252
```

0 commit comments

Comments
 (0)