@@ -126,14 +126,32 @@ class CacheRedisGrailsPlugin extends Plugin {
126
126
usePrefix = isUsePrefix
127
127
}
128
128
129
- grailsCacheFilter(RedisPageFragmentCachingFilter ) {
130
- cacheManager = ref(' grailsCacheManager' )
131
- nativeCacheManager = ref(' grailsCacheRedisTemplate' )
132
- // TODO this name might be brittle - perhaps do by type?
133
- cacheOperationSource = ref(' org.springframework.cache.annotation.AnnotationCacheOperationSource#0' )
134
- keyGenerator = ref(' webCacheKeyGenerator' )
135
- expressionEvaluator = ref(' webExpressionEvaluator' )
136
- }
129
+ /*
130
+ * DOC - !!!!!!!!!!!
131
+ *
132
+ * This is commented out because it introduces a bug causing NullPointerException for file upload,
133
+ * so we don't want to use the `RedisPageFragmentCachingFilter` implementation, but use the default one instead.
134
+ *
135
+ * The bug is: when we do a file upload, we can get the file in the controler by `params.attachmentFile`.
136
+ * That is how we code it in almost every place in DECK. However, when grails cache redis is enabled,
137
+ * the `RedisPageFragmentCachingFilter` implementation would massage the request while doing its caching work,
138
+ * but somehow missed the `attachmentFile`, and `params.attachmentFile` in a controller would be empty.
139
+ * There is a work-around that we can get the file by calling `request.getMultipartFiles()`, but we have to
140
+ * change it for every single place in DECK, which isn't ideal.
141
+ *
142
+ * So this is the bug fix. Also this plugin version is based on an old version of grails-cache plugin - 3.0.3.
143
+ * grails-cache 4.0 has a very different implementation and hopefully this is no longer an issue.
144
+ * Will check it out when we upgrade to Grails 4.
145
+ *
146
+ */
147
+ // grailsCacheFilter(RedisPageFragmentCachingFilter) {
148
+ // cacheManager = ref('grailsCacheManager')
149
+ // nativeCacheManager = ref('grailsCacheRedisTemplate')
150
+ // // TODO this name might be brittle - perhaps do by type?
151
+ // cacheOperationSource = ref('org.springframework.cache.annotation.AnnotationCacheOperationSource#0')
152
+ // keyGenerator = ref('webCacheKeyGenerator')
153
+ // expressionEvaluator = ref('webExpressionEvaluator')
154
+ // }
137
155
}
138
156
}
139
157
0 commit comments