diff --git a/src/moin/apps/frontend/views.py b/src/moin/apps/frontend/views.py index 49489d995..8a4020501 100644 --- a/src/moin/apps/frontend/views.py +++ b/src/moin/apps/frontend/views.py @@ -1266,7 +1266,7 @@ def destroy_item(item_name, rev): ret = render_template( "destroy.html", item=item, - item_name=item_name, + item_name=item_name if item.meta[NAME] else item.meta[NAME_OLD][0], subitem_names=subitem_names, alias_names=alias_names, fqname=fqname, diff --git a/src/moin/items/__init__.py b/src/moin/items/__init__.py index 16ee0c2aa..7af704308 100644 --- a/src/moin/items/__init__.py +++ b/src/moin/items/__init__.py @@ -916,7 +916,10 @@ def destroy(self, comment="", destroy_item=False, subitem_names=[], ajax=False): action = DESTROY_ALL if destroy_item else DESTROY_REV item_modified.send(app, fqname=self.fqname, action=action, data=self.rev.data, meta=self.meta) close_file(self.rev.data) - old_name = self.names if len(self.names) > 1 else self.names[0] + if self.names: + old_name = self.names if len(self.names) > 1 else self.names[0] + else: + old_name = self.meta[NAME_OLD][0] if destroy_item: # destroy complete item with all revisions, metadata, etc. self.rev.item.destroy_all_revisions() diff --git a/src/moin/templates/destroy.html b/src/moin/templates/destroy.html index adaa6c2fc..eee348b1f 100644 --- a/src/moin/templates/destroy.html +++ b/src/moin/templates/destroy.html @@ -11,9 +11,9 @@ {% extends theme("show.html") %} {% if alias_names %} - {% set title = _("Destroy '{item_name}' with alias names {alias_names}").format(item_name=fqname|shorten_fqname, alias_names=alias_names) %} + {% set title = _("Destroy '{item_name}' with alias names {alias_names}").format(item_name=item_name, alias_names=alias_names) %} {% else %} - {% set title = _("Destroy '{item_name}'").format(item_name=fqname|shorten_fqname) %} + {% set title = _("Destroy '{item_name}'").format(item_name=item_name) %} {% endif %} {% block content %}