Skip to content

Commit

Permalink
Full view on working copy fails. Fixes geonetwork#7270
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 authored and fxprunayre committed Aug 18, 2023
1 parent d26daf3 commit 76e7028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void getRecordFormattedBy(
long roundedChangeDate = changeDateAsTime / 1000 * 1000;
if (request.checkNotModified(language, roundedChangeDate) &&
context.getBean(CacheConfig.class).allowCaching(key)) {
if (!skipPopularityBool) {
if (!skipPopularityBool && approved) {
context.getBean(DataManager.class).increasePopularity(context, String.valueOf(metadata.getId()));
}
return;
Expand All @@ -310,7 +310,7 @@ public void getRecordFormattedBy(
bytes = context.getBean(FormatterCache.class).get(key, validator, formatMetadata, false);
}
if (bytes != null) {
if (!skipPopularityBool) {
if (!skipPopularityBool && approved) {
context.getBean(DataManager.class).increasePopularity(context, String.valueOf(metadata.getId()));
}
writeOutResponse(context, metadataUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
this.getFormatterPath = function (defaultFormatter) {
var tokens = $location.path().split("/");
if (tokens.length > 2 && tokens[3] === "formatters") {
return "../api/records/" + $location.url().split(/^metadraf|metadata\//)[1];
return "../api/records/" + $location.url().split(/^\/(metadraf|metadata)\//)[2];
} else if (tokens.length > 2 && tokens[3] === "main") {
return undefined; // Angular view
} else if (defaultFormatter) {
return (
"../api/records/" +
$location.url().split(/^metadraf|metadata\//)[1] +
$location.url().split(/^\/(metadraf|metadata)\//)[2] +
defaultFormatter
);
} else {
Expand Down

0 comments on commit 76e7028

Please sign in to comment.