Compare commits

..

No commits in common. "master" and "v1.27.0" have entirely different histories.

5 changed files with 5 additions and 33 deletions

View file

@ -1,14 +1,5 @@
## [Unreleased]
### Added
* feat(repository): add RepositoryQuery::addCaseInsensitiveFilters()
* feat(repository): add RepositoryQuery::addForcedFilterHandler()
### Fixed
* fix(crud/index): fix row attribute value render
* fix(crud/navigation_setting): fix form action
* fix(crud/template): use default route params
## [v1.27.0] - 2025-12-22
### Fixed
* fix(crud): use route params to redirect after a delation

View file

@ -18,7 +18,6 @@ abstract class RepositoryQuery
protected PaginatorInterface $paginator;
protected string $id;
protected array $forcedFilterHandlers = [];
protected array $caseInsensitiveFilters = [];
public function __construct(ServiceEntityRepository $repository, string $id, PaginatorInterface $paginator = null)
{
@ -89,11 +88,7 @@ abstract class RepositoryQuery
$this->andWhere('.'.$name.' = :'.$name);
$this->setParameter(':'.$name, $value);
} elseif (is_string($value)) {
if (in_array($name, $this->caseInsensitiveFilters)) {
$this->andWhere(sprintf('LOWER ( .%1$s) LIKE LOWER(:%1$s)', $name));
} else {
$this->andWhere('.'.$name.' LIKE :'.$name);
}
$this->andWhere('.'.$name.' LIKE :'.$name);
$this->setParameter(':'.$name, '%'.$value.'%');
} else {
$this->filterHandler($name, $value);
@ -147,18 +142,4 @@ abstract class RepositoryQuery
protected function filterHandler(string $name, $value)
{
}
protected function addCaseInsensitiveFilters(string $name): self
{
$this->caseInsensitiveFilters[] = $name;
return $this;
}
protected function addForcedFilterHandlers(string $name): self
{
$this->forcedFilterHandlers[] = $name;
return $this;
}
}

View file

@ -196,7 +196,7 @@
{% set rowAttributes = configuration.listRowAttributes(context, item) %}
{% set rowClasses = rowAttributes['class']|default('') %}
<tr {{ dataSortableItem|raw }} {% if configuration.doubleClick(context) %}data-dblclick="{{- dbClick -}}"{% endif %} class="{{ loop.index is odd ? 'is-odd' : 'is-even' }} {{ rowClasses }}" {% for attr, attrValue in rowAttributes %}{% if attr != 'class' %}{{ attr }}="{{ attrValue }}" {% endif %}{% endfor %}>
<tr {{ dataSortableItem|raw }} {% if configuration.doubleClick(context) %}data-dblclick="{{- dbClick -}}"{% endif %} class="{{ loop.index is odd ? 'is-odd' : 'is-even' }} {{ rowClasses }}" {% for attr, attrValue in rowAttributes %}{% if attr != 'class' %}{{ attr }}={{ attrValue }} {% endif %}{% endfor %}>
{% if configuration.hasBatchAction(context) %}
<td class="crud-batch-column">
<input type="checkbox" class="batch_form" name="batch[items][{{ loop.index }}]" form="form-batch" value="{{ loop.index }}">

View file

@ -18,7 +18,7 @@
{% block header_actions_before %}{% endblock %}
{% if configuration.action(context, 'back', true) %}
<a href="{{ path(configuration.pageRoute('index'), configuration.pageRouteParams('index')) }}" class="btn btn-light">
<a href="{{ path(configuration.pageRoute('index')) }}" class="btn btn-light">
<span class="fa fa-list pr-1"></span>
<span class="d-none d-md-inline">
{{ configuration.actionTitle(context, 'back', 'Back to the list')|trans }}
@ -27,7 +27,7 @@
{% endif %}
{% if configuration.action(context, 'edit', true, [entity]) %}
<a href="{{ path(configuration.pageRoute('edit'), {entity: entity.id}|merge(configuration.pageRouteParams('edit'))) }}" class="btn btn-primary">
<a href="{{ path(configuration.pageRoute('edit'), {entity: entity.id}) }}" class="btn btn-primary">
<span class="fa fa-edit pr-1"></span>
<span class="d-none d-md-inline">

View file

@ -13,7 +13,7 @@
</button>
</div>
<div class="modal-body">
<form action="{{ path('admin_navigation_setting_edit', {entity: entity.id, redirectTo: redirectTo}) }}" id="form-entity-edit" method="POST">
<form action="{{ path('admin_setting_edit', {entity: entity.id, redirectTo: redirectTo}) }}" id="form-entity-edit" method="POST">
{{ include('@Core/setting/navigation_setting_admin/_form.html.twig') }}
</form>
</div>