Skip to content

Commit 89f8abd

Browse files
committed
Merge branch 'master' of github.com:grails/grails-core
2 parents 2e43aca + a56bff0 commit 89f8abd

File tree

102 files changed

+5224
-5171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5224
-5171
lines changed

src/grails/templates/scaffolding/create.gsp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% import grails.persistence.Event %>
2+
<% import org.codehaus.groovy.grails.plugins.PluginManagerHolder %>
23
<%=packageName%>
34
<html>
45
<head>
@@ -29,10 +30,14 @@
2930
<% excludedProps = Event.allEvents.toList() << 'version' << 'id' << 'dateCreated' << 'lastUpdated'
3031
props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
3132
Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
33+
display = true
34+
boolean hasHibernate = PluginManagerHolder.pluginManager.hasGrailsPlugin('hibernate')
3235
props.each { p ->
3336
if (!Collection.class.isAssignableFrom(p.type)) {
34-
cp = domainClass.constrainedProperties[p.name]
35-
display = (cp ? cp.display : true)
37+
if (hasHibernate) {
38+
cp = domainClass.constrainedProperties[p.name]
39+
display = (cp ? cp.display : true)
40+
}
3641
if (display) { %>
3742
<tr class="prop">
3843
<td valign="top" class="name">

src/grails/templates/scaffolding/edit.gsp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% import grails.persistence.Event %>
2+
<% import org.codehaus.groovy.grails.plugins.PluginManagerHolder %>
23
<%=packageName%>
34
<html>
45
<head>
@@ -32,9 +33,13 @@
3233
<% excludedProps = Event.allEvents.toList() << 'version' << 'id' << 'dateCreated' << 'lastUpdated'
3334
props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
3435
Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
36+
display = true
37+
boolean hasHibernate = PluginManagerHolder.pluginManager.hasGrailsPlugin('hibernate')
3538
props.each { p ->
36-
cp = domainClass.constrainedProperties[p.name]
37-
display = (cp?.display ?: true)
39+
if (hasHibernate) {
40+
cp = domainClass.constrainedProperties[p.name]
41+
display = (cp?.display ?: true)
42+
}
3843
if (display) { %>
3944
<tr class="prop">
4045
<td valign="top" class="name">

src/grails/templates/scaffolding/list.gsp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
if (i < 6) {
2929
if (p.isAssociation()) { %>
3030
<th><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></th>
31-
<% } else { %>
31+
<% } else { %>
3232
<g:sortableColumn property="${p.name}" title="\${message(code: '${domainClass.propertyName}.${p.name}.label', default: '${p.naturalName}')}" />
3333
<% } } } %>
3434
</tr>
@@ -37,7 +37,6 @@
3737
<g:each in="\${${propertyName}List}" status="i" var="${propertyName}">
3838
<tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
3939
<% props.eachWithIndex { p, i ->
40-
cp = domainClass.constrainedProperties[p.name]
4140
if (i == 0) { %>
4241
<td><g:link action="show" id="\${${propertyName}.id}">\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</g:link></td>
4342
<% } else if (i < 6) {

0 commit comments

Comments
 (0)