mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-26 08:51:12 -06:00
Fix for #1617
This commit is contained in:
parent
3ca3ce0726
commit
219a0cd612
@ -323,7 +323,7 @@ class ReportController extends Controller
|
||||
$accounts = implode(',', $request->getAccountList()->pluck('id')->toArray());
|
||||
$categories = implode(',', $request->getCategoryList()->pluck('id')->toArray());
|
||||
$budgets = implode(',', $request->getBudgetList()->pluck('id')->toArray());
|
||||
$tags = implode(',', $request->getTagList()->pluck('tag')->toArray());
|
||||
$tags = implode(',', $request->getTagList()->pluck('id')->toArray());
|
||||
$expense = implode(',', $request->getExpenseList()->pluck('id')->toArray());
|
||||
$uri = route('reports.index');
|
||||
|
||||
|
@ -213,6 +213,12 @@ class ReportFormRequest extends Request
|
||||
$tag = $repository->findByTag($tagTag);
|
||||
if (null !== $tag) {
|
||||
$collection->push($tag);
|
||||
continue;
|
||||
}
|
||||
$tag = $repository->findNull((int)$tagTag);
|
||||
if (null !== $tag) {
|
||||
$collection->push($tag);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ class TagList implements BinderInterface
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$list = array_unique(array_map('\strtolower', explode(',', $value)));
|
||||
Log::debug('List of tags is', $list);
|
||||
if (0 === \count($list)) {
|
||||
Log::error('Tag list is empty.');
|
||||
throw new NotFoundHttpException; // @codeCoverageIgnore
|
||||
@ -56,7 +57,14 @@ class TagList implements BinderInterface
|
||||
|
||||
$collection = $allTags->filter(
|
||||
function (Tag $tag) use ($list) {
|
||||
return \in_array(strtolower($tag->tag), $list, true);
|
||||
if(\in_array(strtolower($tag->tag), $list, true)) {
|
||||
return true;
|
||||
}
|
||||
if(\in_array((string)$tag->id, $list, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col-sm-9">
|
||||
<select id="inputTags" name="tag[]" multiple="multiple" class="form-control">
|
||||
{% for tag in tags %}
|
||||
<option value="{{ tag.tag }}" label="{{ tag.tag }}">{{ tag.tag }}</option>
|
||||
<option value="{{ tag.id }}" label="{{ tag.tag|e('html') }}">{{ tag.tag|e('html') }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user