Project

General

Profile

Actions

Defect #34634

closed

Deletion of project wiki leaves the project wiki inaccessible (404) until module reactivation

Added by Ivan Cenov over 3 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

This issue is inspired by a thread in the forum (Can't add deleted wiki Tab. (404))

An user delete all wiki pages including the root page. Then he could not see the root page and could not create wiki pages any more.

The solution was to disable Wiki module and then enable it again. Then the root wiki page appeared again (may be it has been recreated on enabling wiki module).

So I think that it should be harder to delete the root wiki page or make it not erasable.
However, if it remains erasable, Wiki module should be made inactive when this page is deleted.


Files


Related issues

Related to Redmine - Patch #34643: Cleanups and fixes after Wiki tab removal from project settings (#26579)Closed

Actions
Actions #1

Updated by Ivan Cenov over 3 years ago

Environment

Redmine version 3.4.4.devel
Ruby version 2.4.1-p111 (2017-03-22) [x86_64-linux]
Rails version 5.1.4
Environment production
Database adapter Mysql2

Actions #2

Updated by Mischa The Evil over 3 years ago

  • Status changed from New to Confirmed
  • Assignee set to Mischa The Evil

Thanks for opening this issue. I've been reading along and it already got me curious, so I already had a look at the source. I can confirm the reported behavior (at least partially, as far as I've tested). Along the way I found several other issues too.
I'm working on providing a patch.

Actions #3

Updated by Mischa The Evil over 3 years ago

  • Related to Patch #34643: Cleanups and fixes after Wiki tab removal from project settings (#26579) added
Actions #4

Updated by Mischa The Evil over 3 years ago

  • Category set to Wiki
  • Assignee changed from Mischa The Evil to Ivan Cenov

Ivan Cenov wrote:

An user delete all wiki pages including the root page. Then he could not see the root page and could not create wiki pages any more.

Mischa The Evil wrote:

I can confirm the reported behavior (at least partially, as far as I've tested).

I confirm this is a problem when a whole project wiki is deleted. I don't see this being a problem when deleting single wiki pages.
Ivan Khrustalev: can you too confirm this (also with the OP of Can't add deleted wiki Tab. (404))?

I have posted a patch that fixes this case as part of #34643 (file: 4. Disable the wiki module after deletion of a project wiki.). It should be applicable on its own.

Actions #5

Updated by Mischa The Evil over 3 years ago

  • Description updated (diff)
Actions #6

Updated by Marius BĂLTEANU about 3 years ago

I've extracted the patch proposed by Mischa The Evil in #34643:

  • 4. Disable the wiki module after deletion of a project wiki.
    By adding a (private) after_destroy :disable_wiki_module callback that disables the wiki module after deletion of a project wiki, we prevent the need to explicitly have to disable the wiki module first, before (re-)enabling the module would eventually create a new project wiki and reset the start_page.

I still think that it's a good ideea to inform the user that deleting the wiki root page will automatically disable the module.

Actions #7

Updated by Mischa The Evil about 3 years ago

Marius BALTEANU wrote:

I still think that it's a good ideea to inform the user that deleting the wiki root page will automatically disable the module.

Sure. However, now that I have had a second look at this, I think that disabling the module after the deletion is a bit of an ugly workaround. A better solution would be to implement something like a 'no data' message when a project wiki is missing and add a way for users with the required permission(s) to reinstate a new wiki by just letting them add new pages from the front-end while creating a new project wiki in the background automatically if one is not yet available. That would also take away the need for an additional notification message. What do you think?

Btw: I think you got it but to be certain, when you wrote ...deleting the wiki root page... -> it's actually about deleting the project's wiki itself. I've written about this is more detail in RE: Can't add deleted wiki Tab. (404).

Actions #8

Updated by Marius BĂLTEANU over 2 years ago

What do you think if we create a new empty Wiki after deletion?

Actions #9

Updated by Marius BĂLTEANU over 2 years ago

  • Target version changed from 5.0.0 to 5.1.0
Actions #10

Updated by Mischa The Evil 12 months ago

Marius BALTEANU wrote in #note-8:

What do you think if we create a new empty Wiki after deletion?

FWIW: I think that'll work too. Though, for clarity it might be better to change the name of the proposed class method Wiki.create_default_page to something more generic like just Wiki.create_default since we're actually creating a Wiki object, not an object associated with wiki pages (i.e. WikiPage).

Actions #11

Updated by Go MAEDA 12 months ago

  • Target version changed from 5.1.0 to 6.0.0
Actions #12

Updated by Marius BĂLTEANU 12 months ago

Thanks for your feedback, Mischa. I will try to catch this in 5.1.0.

Actions #13

Updated by Marius BĂLTEANU 12 months ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Marius BĂLTEANU
  • Target version changed from 6.0.0 to 5.1.0
  • Resolution set to Fixed

I've committed the patch that reinitialise an empty wiki page after the project wiki is deleted. I don't see really necessary to have an extra message for this.

Actions #14

Updated by Mischa The Evil 12 months ago

  • Status changed from Resolved to Closed

Marius BALTEANU wrote in #note-13:

I've committed the patch that reinitialise an empty wiki page after the project wiki is deleted. I don't see really necessary to have an extra message for this.

Thanks! And I agree with you that an additional message would be unnecessary.

Actions #15

Updated by Mischa The Evil 12 months ago

  • Subject changed from Can't add deleted wiki Tab (404) to Deletion of project wiki leaves the project wiki inaccessible (404) until module reactivation

Change subject for changelog clarity.

Actions

Also available in: Atom PDF