Skip to content

Commit

Permalink
Merge pull request #1553 from riganti/fix/bp-breakingchange-validator
Browse files Browse the repository at this point in the history
Fixed issue in `Validator` in connection with BP
  • Loading branch information
acizmarik authored Jan 20, 2023
2 parents 477bf10 + 0ee2368 commit 01aafd5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Framework/Framework/Controls/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ private static void AddValidatedValue(IHtmlWriter writer, IDotvvmRequestContext
}
else
{
throw new DotvvmControlException($"Could not resolve {nameof(ValueProperty)} to a valid value binding.");
// Note: ValueProperty can sometimes contain null (BusinessPack depends on this behaviour)
// However, it certainly should not contain hard-coded values

var valueRaw = control.GetValueRaw(ValueProperty);
if (valueRaw != null)
{
// There is a hard-coded value in the ValueProperty
throw new DotvvmControlException($"{nameof(ValueProperty)} can not contain a hard-coded value.");
}
}

// render options
Expand Down

0 comments on commit 01aafd5

Please sign in to comment.