Skip to content

Commit

Permalink
Merge branch 'release/1.6.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
iperdomo committed Apr 25, 2014
2 parents 8b88a89 + 060ceff commit 16e50b0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,6 @@ private synchronized void adaptClusterData(Long surveyedLocaleId) {
return;
}

SurveyInstance si = siDao.getByKey(locale.getLastSurveyalInstanceId());
if (si != null) {
surveyId = si.getSurveyId();
surveyIdString = surveyId.toString();
}

// initialize the memcache
Cache cache = null;
Map props = new HashMap();
Expand Down Expand Up @@ -540,15 +534,23 @@ private synchronized void adaptClusterData(Long surveyedLocaleId) {
return;
}

// get public status, first try from cache
String pubKey = surveyIdString + "-publicStatus";
if (cache.containsKey(pubKey)){
showOnPublicMap = (Boolean) cache.get(pubKey);
} else {
Survey s = sDao.getByKey(surveyId);
if (s != null){
showOnPublicMap = showOnPublicMap || s.getPointType().equals("Point") || s.getPointType().equals("PublicInstitution");
cache.put(pubKey, showOnPublicMap);
if (locale.getLastSurveyalInstanceId() != null){
SurveyInstance si = siDao.getByKey(locale.getLastSurveyalInstanceId());
if (si != null) {
surveyId = si.getSurveyId();
surveyIdString = surveyId.toString();

// get public status, first try from cache
String pubKey = surveyIdString + "-publicStatus";
if (cache.containsKey(pubKey)){
showOnPublicMap = (Boolean) cache.get(pubKey);
} else {
Survey s = sDao.getByKey(surveyId);
if (s != null){
showOnPublicMap = showOnPublicMap || s.getPointType().equals("Point") || s.getPointType().equals("PublicInstitution");
cache.put(pubKey, showOnPublicMap);
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,20 +469,22 @@ private void recomputeLocaleClusters(String cursor) {
surveyId = null;
showOnPublicMap = false;
String surveyIdString = "";
SurveyInstance si = siDao.getByKey(locale.getLastSurveyalInstanceId());
if (si != null) {
surveyId = si.getSurveyId();
surveyIdString = surveyId.toString();

// get public status, first try from cache
String pubKey = surveyIdString + "-publicStatus";
if (cache.containsKey(pubKey)){
showOnPublicMap = (Boolean) cache.get(pubKey);
} else {
Survey s = sDao.getByKey(surveyId);
if (s != null){
showOnPublicMap = (showOnPublicMap != null && showOnPublicMap) || "Point".equals(s.getPointType()) || "PublicInstitution".equals(s.getPointType());
cache.put(pubKey, showOnPublicMap);
if (locale.getLastSurveyalInstanceId() != null){
SurveyInstance si = siDao.getByKey(locale.getLastSurveyalInstanceId());
if (si != null) {
surveyId = si.getSurveyId();
surveyIdString = surveyId.toString();

// get public status, first try from cache
String pubKey = surveyIdString + "-publicStatus";
if (cache.containsKey(pubKey)){
showOnPublicMap = (Boolean) cache.get(pubKey);
} else {
Survey s = sDao.getByKey(surveyId);
if (s != null){
showOnPublicMap = (showOnPublicMap != null && showOnPublicMap) || "Point".equals(s.getPointType()) || "PublicInstitution".equals(s.getPointType());
cache.put(pubKey, showOnPublicMap);
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822).

Akvo FLOW Dashboard release notes
----
#1.6.14.3

## Resolved issues
* avoid NPE when lastSurveyalInstanceId field is null (as happens on old data) [#516]

#1.6.14.2

## Enhancements
Expand Down

0 comments on commit 16e50b0

Please sign in to comment.