diff --git a/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy b/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy index 5dd70440..fa2f13d3 100644 --- a/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy +++ b/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy @@ -564,10 +564,10 @@ class FormFieldsTagLib { List properties if (attrs.order) { + def orderBy = getList(attrs.order) if (attrs.except) { - throwTagError('The [except] and [order] attributes may not be used together.') + orderBy = orderBy - getList(attrs.except) } - def orderBy = getList(attrs.order) properties = orderBy.collect { propertyName -> fieldsDomainPropertyFactory.build(domainClass.getPropertyByName(propertyName)) } diff --git a/src/test/groovy/grails/plugin/formfields/taglib/AllTagSpec.groovy b/src/test/groovy/grails/plugin/formfields/taglib/AllTagSpec.groovy index 93b147b7..bed7a921 100644 --- a/src/test/groovy/grails/plugin/formfields/taglib/AllTagSpec.groovy +++ b/src/test/groovy/grails/plugin/formfields/taglib/AllTagSpec.groovy @@ -86,18 +86,17 @@ class AllTagSpec extends AbstractFormFieldsTagLibSpec implements TagLibUnitTest< } - @Issue('https://github.com/grails3-plugins/fields/issues/9') - void 'order attribute and except attribute are mutually exclusive'() { + @Issue('https://github.com/gpc/fields/issues/347') + void 'allow order and except attributes'() { given: views["/_fields/default/_field.gsp"] = '|${property}|' views["/_fields/default/_wrapper.gsp"] = '${widget}' when: - applyTemplate('', [personInstance: personInstance]) + def output = applyTemplate('', [personInstance: personInstance]) then: - GrailsTagException e = thrown() - e.message.contains 'The [except] and [order] attributes may not be used together.' + output == '|name||gender|' } void "f:all tag supports theme"() {