Skip to content

Commit bc24ec1

Browse files
committedMay 13, 2020
5.0.2-SNAPSHOT
#1279 fixes issue with logging fixes issue with refine button not working on data page fixes issue with hub parameter having values as an array instead of string fixed runtime error when a method cannot be found on a controller
1 parent 77c22f8 commit bc24ec1

File tree

7 files changed

+30
-11
lines changed

7 files changed

+30
-11
lines changed
 

‎.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ branches:
99
- master
1010
- dev
1111
- /^feature\/.*$/
12+
- /^hotfix\/.*$/
1213
before_cache:
1314
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1415
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

‎build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ plugins {
1717
id 'war'
1818
}
1919

20-
version "5.0.1"
20+
version "5.0.2-SNAPSHOT"
2121
group "au.org.ala"
2222

2323
apply plugin:"eclipse"
@@ -133,7 +133,7 @@ dependencies {
133133
compile "org.grails.plugins:ala-admin-plugin:2.1"
134134
if (!inplace) {
135135
compile "org.grails.plugins:ala-map-plugin:3.0"
136-
compile "org.grails.plugins:ecodata-client-plugin:3.0.1"
136+
compile "org.grails.plugins:ecodata-client-plugin:3.0.2-SNAPSHOT"
137137
}
138138
}
139139

‎grails-app/assets/javascripts/facets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function FilterViewModel(config){
215215
sanitisedList.push(item)
216216
}
217217
})
218-
parent.resetPageOffSet();
218+
parent.resetPageOffSet && parent.resetPageOffSet();
219219

220220
self.selectedFacets.push.apply(self.selectedFacets, sanitisedList);
221221
self.hideAllTerms(sanitisedList);

‎grails-app/controllers/au/org/ala/biocollect/AclFilterInterceptor.groovy

+9-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ class AclFilterInterceptor {
3131
return true
3232

3333

34-
def method = controllerClass.getMethod(actionName?:"index", [] as Class[])
34+
def method
35+
def controllerActionName = actionName?:"index"
36+
try {
37+
method = controllerClass.getMethod(controllerActionName, [] as Class[])
38+
} catch (NoSuchMethodException noMethod) {
39+
log.error "No method, ${controllerActionName}, found for controller - ${controllerName}."
40+
}
3541

3642
def roles = roleService.getAugmentedRoles()
3743
def userId = userService.getCurrentUserId(request)
@@ -49,8 +55,8 @@ class AclFilterInterceptor {
4955
params.userIsAlaAdmin = false
5056
}
5157

52-
if (controllerClass.isAnnotationPresent(PreAuthorise) || method.isAnnotationPresent(PreAuthorise)) {
53-
PreAuthorise pa = method.getAnnotation(PreAuthorise)?:controllerClass.getAnnotation(PreAuthorise)
58+
if (controllerClass.isAnnotationPresent(PreAuthorise) || method?.isAnnotationPresent(PreAuthorise)) {
59+
PreAuthorise pa = method?.getAnnotation(PreAuthorise)?:controllerClass.getAnnotation(PreAuthorise)
5460
if ((controllerClass != ProjectController) && (!pa.projectIdParam()?.equals('id'))) {
5561
projectId = params[pa.projectIdParam()]
5662
}

‎grails-app/services/au/org/ala/biocollect/merit/SettingService.groovy

+14-2
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,31 @@ class SettingService {
4444
def loadHubConfig(hub) {
4545

4646
if (!hub) {
47-
hub = grailsApplication.config.app.default.hub?:'default'
48-
GrailsWebRequest.lookup()?.params.hub = hub
47+
// assign hub using the logic
48+
// 1. Use previous hub from cookie.
49+
// 2. Otherwise, use default hub setting.
4950
String previousHub = cookieService.getCookie(LAST_ACCESSED_HUB)
5051
if (!previousHub) {
52+
hub = grailsApplication.config.app.default.hub?:'default'
5153
cookieService.setCookie(LAST_ACCESSED_HUB, hub, -1 /* -1 means the cookie expires when the browser is closed */)
5254
}
55+
else {
56+
hub = previousHub
57+
}
5358
}
5459
else {
60+
// Hub value in multiple places like url path and in parameter causes Array to be passed instead of String.
61+
// This causes setCookie method to throw exception since it expects String.
62+
if (hub && ((hub instanceof List) || hub.getClass().isArray())) {
63+
hub = hub[0]
64+
}
65+
5566
// Store the most recently accessed hub in a cookie so that 404 errors can be presented with the
5667
// correct skin.
5768
cookieService.setCookie(LAST_ACCESSED_HUB, hub, -1 /* -1 means the cookie expires when the browser is closed */)
5869
}
5970

71+
GrailsWebRequest.lookup().params.hub = hub
6072
def settings = getHubSettings(hub)
6173
if (!settings) {
6274
log.warn("no settings returned for hub ${hub}!")

‎grails-app/views/bioActivity/previewActivity.gsp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!DOCTYPE html>
44
<html xmlns="http://www.w3.org/1999/html">
55
<head>
6-
<meta name="layout" content="ajaxLayout"/>
6+
<meta name="layout" content="${hubConfig.skin}"/>
77

88
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js"></script>
99
<asset:stylesheet src="common.css"/>
1010
<asset:stylesheet src="forms-manifest.css"/>
1111
<g:if test="${hubConfig.skin == "configurableHubTemplate1"}">
1212
<link rel="stylesheet" type="text/css"
13-
href="${createLink(controller: 'hub', action: 'getStyleSheet')}?hub=${hubConfig.urlPath}&ver=${hubConfig.lastUpdated}">
13+
href="${createLink(controller: 'hub', action: 'getStyleSheet')}?ver=${hubConfig.lastUpdated}">
1414
</g:if>
1515
<asset:script type="text/javascript">
1616
var fcConfig = {

‎grails-app/views/layouts/configurableHubTemplate1.gsp

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
</asset:script>
8686
<g:layoutHead/>
8787
<link rel="stylesheet" type="text/css"
88-
href="${createLink(controller: 'hub', action: 'getStyleSheet')}?hub=${hubConfig.urlPath}&ver=${hubConfig.lastUpdated}">
88+
href="${createLink(controller: 'hub', action: 'getStyleSheet')}?ver=${hubConfig.lastUpdated}">
8989
<link href="${grailsApplication.config.skin.favicon}" rel="icon"/>
9090
</head>
9191

0 commit comments

Comments
 (0)