added required validator for the TextField.Pattern option in case it is a primary key

This commit is contained in:
Gani Georgiev
2024-11-19 17:21:25 +02:00
parent 48328bf33f
commit 9fe4f87e5b
8 changed files with 31 additions and 9 deletions

View File

@@ -391,7 +391,7 @@ func (f *FileField) Intercept(
}
func (f *FileField) getLatestOldValue(app App, record *Record) any {
if !record.IsNew() {
latestOriginal, err := app.FindRecordById(record.Collection(), record.Original().Id)
latestOriginal, err := app.FindRecordById(record.Collection(), cast.ToString(record.LastSavedPK()))
if err == nil {
return latestOriginal.GetRaw(f.Name)
}