Skip to content

Commit

Permalink
Fix issues with filter registration appearing after latte/latte upd…
Browse files Browse the repository at this point in the history
…ate to version `2.11.5`.

Originally latte searched for filter implementation by searching the registered callback
with lower-cased title of the filter. This version changed that and used original name
of the filter that was used for the registration.

This caused some of our filters to stop working. Main fix is in FilterLoader class.

remp/crm#2511

(cherry picked from commit 5de85e934982e4fc24457f062c6d352a60035d77)
  • Loading branch information
rootpd committed Jun 30, 2022
1 parent 84cf572 commit 07eeb5b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Helpers/FilterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Crm\ApplicationModule\Helpers;

use Nette\Utils\Strings;

class FilterLoader
{
/** @var array All registered filters */
Expand All @@ -22,6 +20,6 @@ public function load(string $helper)

public function register(string $name, callable $callback)
{
$this->filters[Strings::lower($name)] = $callback;
$this->filters[$name] = $callback;
}
}

0 comments on commit 07eeb5b

Please sign in to comment.