mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 07:18:54 +00:00
tpl/collections: Include key in IsSet unsupported-type warning
The warning logged when calling IsSet with an unsupported type did not identify which key triggered it, making it hard to locate the offending template. Include the key in the message. Fixes #11794
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
a879ebfaaa
commit
671897ae91
@@ -347,7 +347,7 @@ func (ns *Namespace) IsSet(c any, key any) (bool, error) {
|
||||
return av.MapIndex(kv).IsValid(), nil
|
||||
}
|
||||
default:
|
||||
ns.deps.Log.Warnf("calling IsSet with unsupported type %q (%T) will always return false.\n", av.Kind(), c)
|
||||
ns.deps.Log.Warnf("calling IsSet with unsupported type %q (%T) for key %v will always return false.\n", av.Kind(), c, key)
|
||||
}
|
||||
|
||||
return false, nil
|
||||
|
||||
Reference in New Issue
Block a user