Skip to content

Commit

Permalink
Bug: tags reset after issue creator update
Browse files Browse the repository at this point in the history
Issue #39
  • Loading branch information
satrun77 committed Aug 18, 2016
1 parent 4667227 commit 6c28ccd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Model/Traits/Project/Issue/CrudTagTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public function syncTags(array $input, Collection $currentTags = null)
$tagIds = array_only($input, [
'tag_type', 'tag_status', 'tag_resolution',
]);

// User can edit their own role and can only change issue type
if ($this->updatedBy instanceof User && $this->updatedBy->isUser()) {
$currentTagIds = $currentTags->pluck('id', 'parent.name')->toArray();
$tagIds['tag_status'] = array_key_exists('status', $currentTagIds)? $currentTagIds['status'] : 0;
$tagIds['tag_resolution'] = array_key_exists('resolution', $currentTagIds)? $currentTagIds['resolution'] : 0;
}

$tags = (new Tag())->whereIn('id', $tagIds)->get();

$removedTags = [];
Expand Down

0 comments on commit 6c28ccd

Please sign in to comment.