From 3932c46f914c40be4b0629771d1981cdf289df26 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 18 Mar 2024 11:21:08 +0100 Subject: [PATCH] [FIX] website_slides: remove old code + fix xml and key error tb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the aria-current was the name of the search_X instead of value 'page'. Code was strange since `'page' and X` == `X`, while we expect 'page' as value. In case of unknown 'search_slide_category' value, use '-' instead to raise a KeyError Exception. We still have some links that point to old url with slide category of type 'presentation' that doesn't exist anymore since the v16. Remove outdate code following the comment: > I swear though, don't be afraid, remove it! From this way, the wrong slide_type of type 'presentation' will be ignored in all case and link from google will show the slide instead of an error 500. closes odoo/odoo#158002 Signed-off-by: Jérémy Kersten --- addons/website_slides/controllers/main.py | 4 --- .../views/website_slides_templates_course.xml | 30 +++++++++---------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index a8413154fa0..3675da795c0 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -562,10 +562,6 @@ class WebsiteSlides(WebsiteProfile): if category_id and not category: category = channel.slide_category_ids.filtered(lambda category: category.id == category_id) - # retro-compatibility for older links, 'slide_category' field was previously named 'slide_type' - # can be safely removed after 15.3 (I swear though, don't be afraid, remove it!) - slide_category = slide_category or kw.get('slide_type') - domain = self._get_channel_slides_base_domain(channel) pager_url = "/slides/%s" % (channel.id) pager_args = valid_invite_values.get('pager_args', {}) diff --git a/addons/website_slides/views/website_slides_templates_course.xml b/addons/website_slides/views/website_slides_templates_course.xml index 7b8e09bbcb8..0ae1f634a06 100644 --- a/addons/website_slides/views/website_slides_templates_course.xml +++ b/addons/website_slides/views/website_slides_templates_course.xml @@ -17,19 +17,19 @@ -
  • - - +
  • + +
  • -
  • - +
  • +
  • -
  • - Uncategorized - Uncategorized +
  • + Uncategorized + Uncategorized
  • -
  • - +
  • +