From ab4a01f15ba581c4ad3c4213f361ff6a693f0817 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Thu, 4 Aug 2022 09:12:48 +0200 Subject: [PATCH] Merge pull request #8996 from overleaf/msm-ce-sp-hotfix-3-1-1 [CE/SP] Hotfix 3.1.1 GitOrigin-RevId: f1c3feb17e90f9cd1050b7a2b4ad18e7db9a8ed3 --- server-ce/hotfix/3.1.1/Dockerfile | 11 +++++++++++ .../hotfix/3.1.1/fix-history-navigation.patch | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 server-ce/hotfix/3.1.1/Dockerfile create mode 100644 server-ce/hotfix/3.1.1/fix-history-navigation.patch diff --git a/server-ce/hotfix/3.1.1/Dockerfile b/server-ce/hotfix/3.1.1/Dockerfile new file mode 100644 index 0000000000..b0b5b6f193 --- /dev/null +++ b/server-ce/hotfix/3.1.1/Dockerfile @@ -0,0 +1,11 @@ +FROM sharelatex/sharelatex:3.1.0 + +# Patch: fixes Sharelatex History navigation +# https://github.com/overleaf/overleaf/issues/1035 +COPY fix-history-navigation.patch . +RUN patch -p0 < fix-history-navigation.patch + + +# Rebuild client +# -------------- +RUN node genScript compile | bash diff --git a/server-ce/hotfix/3.1.1/fix-history-navigation.patch b/server-ce/hotfix/3.1.1/fix-history-navigation.patch new file mode 100644 index 0000000000..0033abfa01 --- /dev/null +++ b/server-ce/hotfix/3.1.1/fix-history-navigation.patch @@ -0,0 +1,16 @@ +--- services/web/frontend/js/ide/history/controllers/HistoryListController.js ++++ services/web/frontend/js/ide/history/controllers/HistoryListController.js +@@ -62,7 +62,12 @@ App.controller('HistoryListController', function ($scope, $modal, ide) { + return (() => { + const result = [] + for (const update of Array.from($scope.history.updates)) { +- let inSelection ++ ++ // replacing this declaration with `let` introduces a bug in history point selection: ++ // https://github.com/overleaf/overleaf/issues/1035 ++ // eslint-disable-next-line no-var ++ var inSelection ++ + if (update.selectedTo) { + inSelection = true + beforeSelection = false \ No newline at end of file