mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Fix for #1617
This commit is contained in:
@@ -323,7 +323,7 @@ class ReportController extends Controller
|
|||||||
$accounts = implode(',', $request->getAccountList()->pluck('id')->toArray());
|
$accounts = implode(',', $request->getAccountList()->pluck('id')->toArray());
|
||||||
$categories = implode(',', $request->getCategoryList()->pluck('id')->toArray());
|
$categories = implode(',', $request->getCategoryList()->pluck('id')->toArray());
|
||||||
$budgets = implode(',', $request->getBudgetList()->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());
|
$expense = implode(',', $request->getExpenseList()->pluck('id')->toArray());
|
||||||
$uri = route('reports.index');
|
$uri = route('reports.index');
|
||||||
|
|
||||||
|
@@ -213,6 +213,12 @@ class ReportFormRequest extends Request
|
|||||||
$tag = $repository->findByTag($tagTag);
|
$tag = $repository->findByTag($tagTag);
|
||||||
if (null !== $tag) {
|
if (null !== $tag) {
|
||||||
$collection->push($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()) {
|
if (auth()->check()) {
|
||||||
$list = array_unique(array_map('\strtolower', explode(',', $value)));
|
$list = array_unique(array_map('\strtolower', explode(',', $value)));
|
||||||
|
Log::debug('List of tags is', $list);
|
||||||
if (0 === \count($list)) {
|
if (0 === \count($list)) {
|
||||||
Log::error('Tag list is empty.');
|
Log::error('Tag list is empty.');
|
||||||
throw new NotFoundHttpException; // @codeCoverageIgnore
|
throw new NotFoundHttpException; // @codeCoverageIgnore
|
||||||
@@ -56,7 +57,14 @@ class TagList implements BinderInterface
|
|||||||
|
|
||||||
$collection = $allTags->filter(
|
$collection = $allTags->filter(
|
||||||
function (Tag $tag) use ($list) {
|
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">
|
<div class="col-sm-9">
|
||||||
<select id="inputTags" name="tag[]" multiple="multiple" class="form-control">
|
<select id="inputTags" name="tag[]" multiple="multiple" class="form-control">
|
||||||
{% for tag in tags %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user