You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If addFilter() method is used BEFORE other rules, they are dropped and passed to HTML. Even documentation states that:
The filter is included between the validation rules and conditions and therefore depends on the order of the methods, i.e. the filter and the rule are called in the same order as is the order of the addFilter() and addRule() methods.
Fix Nette\Forms\Helpers to NOT to exit whole foreach loop, when rule is not exportable.
namespaceNette\Forms;
useNette;
useNette\Utils\Html;
useNette\Utils\Image;
useNette\Utils\Strings;
/** * Forms helpers. */finalclassHelpers
public staticfunction exportRules(Rules$rules): array
{
$payload = [];
foreach ($rulesas$rule) {
if (!$rule->canExport()) {
if ($rule->branch) {
continue;
}
/** * 👇 this is the problem, when replaced * by continue; seems to works, but I am not sure * it doesn't break something else */break;
}
The text was updated successfully, but these errors were encountered:
Version: 3.2.2 (still present in master)
Bug Description
If
addFilter()
method is used BEFORE other rules, they are dropped and passed to HTML. Even documentation states that:Steps To Reproduce
Nette fiddle ilustrating the problem.
Expected Behavior
All rules should be exported.
Possible Solution
Fix
Nette\Forms\Helpers
to NOT to exit wholeforeach
loop, when rule is not exportable.The text was updated successfully, but these errors were encountered: