Browse files

URL of BlogEntry no longer changes after its been updated

  • Loading branch information...
1 parent 0a5f7b5 commit c2559acb33d2e91f85e0863c100a579de46f1aec @domurtag domurtag committed Feb 5, 2013
View
3 .gitignore
@@ -3,4 +3,5 @@ target/
/plugin.xml
*.log
.settings
-web-app
+web-app
+*.iml
View
3 SimpleBlogGrailsPlugin.groovy
@@ -1,7 +1,8 @@
class SimpleBlogGrailsPlugin {
- def version = '0.2.1'
+ def version = '0.2.2'
def grailsVersion = '1.3 > *'
def author = 'Graeme Rocher'
+ def developers = [[name: 'Donal Murtagh']]
def authorEmail = ''
def title = 'Simple Blog'
def description = 'Adds a simple blog interface to an application'
View
4 application.properties
@@ -1 +1,3 @@
-app.grails.version=2.0.1
+#Grails Metadata file
+#Tue Feb 05 21:51:17 CET 2013
+app.grails.version=2.1.1
View
3 grails-app/controllers/org/grails/blog/BlogController.groovy
@@ -97,7 +97,8 @@ class BlogController {
entry.properties = params['entry']
def authorEvaluator = grailsApplication.config.grails.blog.author.evaluator
- if(authorEvaluator instanceof Closure) {
+ // don't change the author if updating an entry, because this will cause the entry's URL to change
+ if(!entry.author && authorEvaluator instanceof Closure) {
authorEvaluator.delegate = this
authorEvaluator.resolveStrategy = Closure.DELEGATE_FIRST
entry.author = authorEvaluator.call()?.toString()

0 comments on commit c2559ac

Please sign in to comment.