Patch #34643

Cleanups and fixes after Wiki tab removal from project settings (#26579)

Added by Mischa The Evil 9 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Wiki
Target version:-

Description

This is a series of patches that includes cleanups, fixes and improvements after the Wiki tab was removed from the project settings per #26579:

  • 1. Remove 'edit' action from :manage_wiki permission definition in Redmine::AccessControl.
    Wikis#edit is removed by r17018.
  • 2. Redirect_to project_path after WikisController#destroy.
    • Project settings 'wiki' tab is removed by r16917 & r17017.
    • This action is executed outside the project settings scope after r16916, thus we can better redirect to project_path.
  • 3. Set :wiki menu_item for WikisController#destroy.
    This action is executed inside the project wiki scope after r16916, thus we can better set the menu_item accordingly.
  • 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.
  • 5. Changed wiki :start_page name to I18n'ed :field_start_page within EnabledModule#module_enabled.
    This prevents a default 'projectid/wiki/Wiki' URL for the project wiki start page.
    The test assertion is updated to reflect this change and the containing test is adjusted to handle the i18n'ed text. Code formatting is adjusted whenever code was touched anyways.

This patch series, against source:/trunk@20729, is produced using git format-patch which makes it apply-able using "patch -p1 < 0001-...".

Environment:

Environment:
  Redmine version                4.1.1.devel@r20729
  Ruby version                   2.5.8-p224 (2020-03-31) [x64-mingw32]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                test
SCM:
  Git                            2.26.0
  Filesystem                     
Redmine plugins:
  no plugin installed

0001-Remove-edit-action-from-manage_wiki-permission-defin.patch Magnifier (1.04 KB) Mischa The Evil, 2021-01-27 09:59

0002-Redirect_to-project_path-after-WikisController-destr.patch Magnifier (1.69 KB) Mischa The Evil, 2021-01-27 09:59

0003-Set-wiki-menu_item-for-WikisController-destroy.patch Magnifier (939 Bytes) Mischa The Evil, 2021-01-27 09:59

0004-Disable-the-wiki-module-after-deletion-of-a-project-.patch Magnifier (2.21 KB) Mischa The Evil, 2021-01-27 09:59

0005-Changed-wiki-start_page-name-to-I18n-ed-field_start_.patch Magnifier (2.4 KB) Mischa The Evil, 2021-01-27 09:59


Related issues

Related to Redmine - Defect #34634: Can't add deleted wiki Tab (404) Confirmed
Follows Redmine - Feature #26579: Project settings : remove Wiki tab Closed
Copied to Redmine - Patch #35610: Cleanups after Wiki tab removal from project settings (#2... Closed

History

#1 Updated by Mischa The Evil 9 months ago

#2 Updated by Mischa The Evil 9 months ago

  • Related to Defect #34634: Can't add deleted wiki Tab (404) added

#3 Updated by Go MAEDA 9 months ago

Thank you for posting the patch. I have tried out the patches and confirmed the first four patches fix existing issues.

However, I am afraid the change by attachment:0005-Changed-wiki-start_page-name-to-I18n-ed-field_start_.patch is sometimes confusing. Assume the following situation.

1. Create the first Wiki page on a project. The page title will be "Start page"
2. Create a new page with the title "Foo"
3. Set the page "Foo" as a start page

Even after changing the start page to "Foo", the first page's title is still "Start page" despite the page is no longer a start page. Despite a page with the name "Start page" exists, the link "Start page" in the sidebar points to "Foo" page instead of "Start page". I think it is confusing.

#4 Updated by Go MAEDA 9 months ago

How about committing the first four patches first, and discussing the fifth patch as a separate issue?

#5 Updated by Mischa The Evil 7 months ago

  • Subject changed from Cleanups, fixes and improvements after Wiki tab removal from project settings (#26579) to Cleanups and fixes after Wiki tab removal from project settings (#26579)

Go MAEDA wrote:

How about committing the first four patches first, and discussing the fifth patch as a separate issue?

Sorry for the delayed response. I agree with you. I should have separated them in the first place as their changes are unrelated. FWIW: I'd also be ok with dropping the fifth patch altogether early at the gate, given the possible confusion and the severity of the "issue".

#6 Updated by Go MAEDA 6 months ago

  • Target version set to Candidate for next major release

#7 Updated by Go MAEDA 6 months ago

  • Target version changed from Candidate for next major release to 4.2.2

Setting the target version to 4.2.2.

#8 Updated by Marius BALTEANU 5 months ago

Should we add a message to the delete confirmation message to inform the user that deleting the root wiki will disable the module?

#9 Updated by Marius BALTEANU 3 months ago

  • Copied to Patch #35610: Cleanups after Wiki tab removal from project settings (#26579) added

#10 Updated by Marius BALTEANU 3 months ago

  • Status changed from New to Closed
  • Target version deleted (4.2.2)

I've committed first 3 patches as part of #35610 for Redmine 5.0.0.

Regarding point 4, we can continue the discussions in #34634 which is now assigned to 5.0.0.

Thanks Mischa The Evil for providing the patches.

Also available in: Atom PDF