From da15b442e02e9450827e4c24ed6401a115d5c055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20R=C3=BCdenauer?= Date: Tue, 7 Oct 2025 18:47:10 +0200 Subject: [PATCH] Fix code and jinja templates accessing the no longer existing wiki configuration setting 'item_root'. Also change documentation and comments mentioning 'item_root'. --- docs/admin/configure.rst | 4 ++-- src/moin/_tests/wikiconfig.py | 2 +- src/moin/config/default.py | 2 +- src/moin/config/wikiconfig.py | 2 +- src/moin/templates/layout.html | 2 +- src/moin/themes/basic/templates/layout.html | 4 ++-- src/moin/themes/focus/templates/layout.html | 2 +- src/moin/themes/topside/templates/layout.html | 2 +- src/moin/utils/interwiki.py | 3 +-- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/admin/configure.rst b/docs/admin/configure.rst index f79d0958d..7450a6b31 100644 --- a/docs/admin/configure.rst +++ b/docs/admin/configure.rst @@ -1454,7 +1454,7 @@ To configure custom namespaces, find the section in wikiconfig.py that looks sim hierarchic=False, ), } namespace_mapping, backend_mapping, acl_mapping = create_mapping(uri, namespaces, backends, acls, ) - # define mapping of namespaces to unique item_roots (home pages within namespaces). + # define mapping of namespaces to unique root items (home pages within namespaces). root_mapping = {'users': 'UserHome', } # default root, use this value by default for all namespaces default_root = 'Home' @@ -1616,4 +1616,4 @@ Make sure to use an absolute path that points to a valid logging configuration f **Important:** The logging configuration must be stored in a **separate file** — do **not** place it inside your `wikiconfig.py`. -If no configuration is provided, or if the provided configuration file cannot be loaded, Moin will fall back to a built-in default configuration, which logs to `stderr` at the `INFO` level. \ No newline at end of file +If no configuration is provided, or if the provided configuration file cannot be loaded, Moin will fall back to a built-in default configuration, which logs to `stderr` at the `INFO` level. diff --git a/src/moin/_tests/wikiconfig.py b/src/moin/_tests/wikiconfig.py index 48bec262a..7ff460b25 100644 --- a/src/moin/_tests/wikiconfig.py +++ b/src/moin/_tests/wikiconfig.py @@ -25,7 +25,7 @@ class Config(DefaultConfig): data_dir = join(_here, "wiki", "data") # needed for plugins package TODO index_storage = "FileStorage", (join(_here, "wiki", "index"),), {} default_acl = None - item_root = "FrontPage" + default_root = "FrontPage" interwikiname = "MoinTest" interwiki_map = dict(Self="http://localhost:8080/", MoinMoin="http://moinmo.in/") interwiki_map[interwikiname] = "http://localhost:8080/" diff --git a/src/moin/config/default.py b/src/moin/config/default.py index 98c383a0a..3e35461aa 100644 --- a/src/moin/config/default.py +++ b/src/moin/config/default.py @@ -546,7 +546,7 @@ def __init__(self, exprstr): "Home", "Default root, use this value in case no match is found in root_mapping. [Unicode]", ), - ("root_mapping", {}, "mapping of namespaces to item_roots."), + ("root_mapping", {}, "mapping of namespaces to unique root items."), # the following regexes should match the complete name when used in free text # the group 'all' shall match all, while the group 'key' shall match the key only # e.g. FooGroup -> group 'all' == FooGroup, group 'key' == Foo diff --git a/src/moin/config/wikiconfig.py b/src/moin/config/wikiconfig.py index 4dd4eda59..27b1614a5 100644 --- a/src/moin/config/wikiconfig.py +++ b/src/moin/config/wikiconfig.py @@ -236,7 +236,7 @@ class Config(DefaultConfig): # TODO If there is a future change that requires wiki admins to merge this wikiconfig with the customized wikiconfig # then remove the "uri" parameter in create mapping below and in storage/__init__.py. namespace_mapping, backend_mapping, acl_mapping = create_mapping(uri, namespaces, backends, acls) - # define mapping of namespaces to unique item_roots (home pages within namespaces). + # define mapping of namespaces to unique root items (home pages within namespaces). root_mapping = {"users": "UserHome"} # default root, use this value by default for all namespaces default_root = "Home" diff --git a/src/moin/templates/layout.html b/src/moin/templates/layout.html index 17a995955..ed7123895 100644 --- a/src/moin/templates/layout.html +++ b/src/moin/templates/layout.html @@ -30,7 +30,7 @@ {{ utils.user_login_logoff() }} {% if cfg.sitename %} - + {{ cfg.sitename }} {% endif %} diff --git a/src/moin/themes/basic/templates/layout.html b/src/moin/themes/basic/templates/layout.html index 7677b4bae..66d7509aa 100644 --- a/src/moin/themes/basic/templates/layout.html +++ b/src/moin/themes/basic/templates/layout.html @@ -74,7 +74,7 @@
{% endif %} {% if cfg.sitename %} - + {{ cfg.sitename }} {% endif %} diff --git a/src/moin/themes/topside/templates/layout.html b/src/moin/themes/topside/templates/layout.html index 8bc36ca0b..dde10e961 100644 --- a/src/moin/themes/topside/templates/layout.html +++ b/src/moin/themes/topside/templates/layout.html @@ -22,7 +22,7 @@ {%- endif %} {%- if cfg.sitename %} - + {{ cfg.sitename }} {%- endif %} diff --git a/src/moin/utils/interwiki.py b/src/moin/utils/interwiki.py index 6b54b4364..d53344935 100644 --- a/src/moin/utils/interwiki.py +++ b/src/moin/utils/interwiki.py @@ -190,8 +190,7 @@ def query(self): def get_root_fqname(self): """ - Set value to the item_root of that namespace, and return - the new CompositeName. + Determine the root item of the namespace of this composite name and return it as new CompositeName instance. """ return CompositeName(self.namespace, NAME_EXACT, app.cfg.root_mapping.get(self.namespace, app.cfg.default_root))