Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BeanPropertyAccessorFactory implements GrailsApplicationAware {
if (bean == null) {
new PropertyPathAccessor(propertyPath)
} else {
resolvePropertyFromPath(bean, propertyPath)
resolvePropertyFromPath(unwrapIfProxy(bean), propertyPath)
}
}

Expand Down Expand Up @@ -180,7 +180,11 @@ class BeanPropertyAccessorFactory implements GrailsApplicationAware {
}

private BeanWrapper beanWrapperFor(Class type, value) {
value ? PropertyAccessorFactory.forBeanPropertyAccess(proxyHandler.unwrapIfProxy(value)) : new BeanWrapperImpl(type)
value ? PropertyAccessorFactory.forBeanPropertyAccess(unwrapIfProxy(value)) : new BeanWrapperImpl(type)
}

private Object unwrapIfProxy(value) {
return proxyHandler.unwrapIfProxy(value)
}

private static final Pattern INDEXED_PROPERTY_PATTERN = ~/^(\w+)\[(.+)]$/
Expand All @@ -195,4 +199,6 @@ class BeanPropertyAccessorFactory implements GrailsApplicationAware {
def matcher = propertyName =~ INDEXED_PROPERTY_PATTERN
matcher.matches() ? (matcher[0] as String[])[1] : propertyName
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.grails.datastore.mapping.model.PersistentEntity
import org.grails.datastore.mapping.model.PersistentProperty
import org.grails.scaffolding.model.property.Constrained
import org.grails.scaffolding.model.property.DomainProperty
import org.springframework.validation.Errors
import org.springframework.validation.FieldError

@CompileStatic
Expand Down
Loading