From cc3c72ef010c21edc8b2411fec7da2d6d288406a Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 4 Feb 2025 16:36:30 +0100 Subject: [PATCH 1/6] fix file:/// as external link in summary --- CHANGES.rst | 3 +++ src/redturtle/volto/restapi/serializer/summary.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4134f113..e2175983 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Changelog 5.6.4 (unreleased) ------------------ +- fix file:/// as external link in summary + [mamico] + - Update it translations [lucabel] diff --git a/src/redturtle/volto/restapi/serializer/summary.py b/src/redturtle/volto/restapi/serializer/summary.py index f1b49bb8..b886f84f 100644 --- a/src/redturtle/volto/restapi/serializer/summary.py +++ b/src/redturtle/volto/restapi/serializer/summary.py @@ -81,7 +81,11 @@ def get_remote_url(self): value = self.context.getRemoteUrl if not value: return "" - if value.startswith("http"): + if ( + value.startswith("http:") + or value.startswith("https:") + or value.startswith("file:") + ): # it isn't an internal link, so we can return it return value path = replace_link_variables_by_paths(context=self.context, url=value) From 184daed2892f9ef285460e61cf46f4ff8f3977e1 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 4 Feb 2025 16:38:02 +0100 Subject: [PATCH 2/6] ci --- .github/workflows/zpretty.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/zpretty.yml b/.github/workflows/zpretty.yml index 180f0e96..49a04e3d 100644 --- a/.github/workflows/zpretty.yml +++ b/.github/workflows/zpretty.yml @@ -6,20 +6,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8] + python-version: [3.11] steps: # git checkout - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # python cache - - uses: actions/cache@v1 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} From 98d3dee85d6a220b595e60b8952cded865b0ac00 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 4 Feb 2025 16:44:34 +0100 Subject: [PATCH 3/6] ci --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61378643..c45107f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,8 +11,10 @@ jobs: strategy: max-parallel: 4 matrix: - python: ["3.8", "3.9", "3.10", "3.11"] - plone: ["52", "60"] + # python: ["3.8", "3.9", "3.10", "3.11"] + # plone: ["52", "60"] + python: ["3.9", "3.10", "3.11"] + plone: ["60"] tz: ["UTC", "Europe/Rome"] exclude: - python: "3.8" From a27bfbdb66787c1ab871e07a95c33c57a8befda4 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 4 Feb 2025 16:50:54 +0100 Subject: [PATCH 4/6] black --- src/redturtle/volto/restapi/serializer/summary.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/redturtle/volto/restapi/serializer/summary.py b/src/redturtle/volto/restapi/serializer/summary.py index b886f84f..5cc82224 100644 --- a/src/redturtle/volto/restapi/serializer/summary.py +++ b/src/redturtle/volto/restapi/serializer/summary.py @@ -81,13 +81,15 @@ def get_remote_url(self): value = self.context.getRemoteUrl if not value: return "" - if ( - value.startswith("http:") - or value.startswith("https:") - or value.startswith("file:") - ): - # it isn't an internal link, so we can return it + + # it isn't an internal link, so we can return it + if value.startswith("http:"): + return value + if value.startswith("https:"): return value + if value.startswith("file:"): + return value + path = replace_link_variables_by_paths(context=self.context, url=value) url = uid_to_url(path) From a22a78d3c048343c8e9455779f680768696fb87c Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 4 Feb 2025 16:51:52 +0100 Subject: [PATCH 5/6] ci --- .github/workflows/zpretty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zpretty.yml b/.github/workflows/zpretty.yml index 49a04e3d..154b42aa 100644 --- a/.github/workflows/zpretty.yml +++ b/.github/workflows/zpretty.yml @@ -14,7 +14,7 @@ jobs: # python setup - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 6d42eca121777d29f214ad90976c26e2402a76b8 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Wed, 5 Feb 2025 09:51:35 +0100 Subject: [PATCH 6/6] py38/plone52 --- .github/workflows/tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c45107f9..ca693de1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,10 +11,8 @@ jobs: strategy: max-parallel: 4 matrix: - # python: ["3.8", "3.9", "3.10", "3.11"] - # plone: ["52", "60"] - python: ["3.9", "3.10", "3.11"] - plone: ["60"] + python: ["3.8", "3.9", "3.10", "3.11"] + plone: ["52", "60"] tz: ["UTC", "Europe/Rome"] exclude: - python: "3.8" @@ -33,6 +31,7 @@ jobs: path: eggs key: ${{ runner.OS }}-build-python${{ matrix.python }}-${{ matrix.plone }} - name: Set up Python ${{ matrix.python }} + # don't upgrade this action version, as we want to support plone52/py38 uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }}