Changeset 352 for trunk/grails-app/controllers
- Timestamp:
- Feb 12, 2010, 12:14:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AssetSubItemDetailedController.groovy
r347 r352 116 116 flash.message = "AssetSubItem not found with id ${params.id}" 117 117 redirect(action: "search") 118 } 119 else { 120 return [ assetSubItemInstance : assetSubItemInstance ] 121 } 118 return 119 } 120 121 def possibleParentItems = assetSubItemService.possibleParentItems(assetSubItemInstance) 122 123 return [ assetSubItemInstance : assetSubItemInstance, possibleParentItems: possibleParentItems ] 122 124 } 123 125 … … 137 139 assetSubItemInstance.properties = params 138 140 139 // if(!assetSubItemInstance.asset && !assetSubItemInstance.parentItem) { 140 // flash.message = "Either an asset or parentItem is required." 141 // render(view:'edit',model:[assetSubItemInstance:assetSubItemInstance]) 142 // return 143 // } 144 // 145 // if(assetSubItemInstance.asset && assetSubItemInstance.parentItem) { 146 // flash.message = "Both an asset and parentItem may not be specified at the same time." 147 // render(view:'edit',model:[parentItem:parentItem]) 148 // return 149 // } 141 if(assetSubItemInstance.assets) { 142 assetSubItemInstance.parentItem = null 143 } 150 144 151 145 if(!assetSubItemInstance.hasErrors() && assetSubItemInstance.save(flush: true)) {
Note: See TracChangeset
for help on using the changeset viewer.