Patch #31334

Do not lose content when updating a wiki page that has been renamed in the meantime

Added by Jens Krämer 4 months ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Wiki
Target version:3.4.11

Description

This is a corner case, but it happened recently with a client here at Planio.

When somebody renames a wiki page while somebody else is editing it, the latter will lose any updates to the content upon save due to the redirect performed by the find_existing_or_new_page before action.

This patch adds an integration test that reproduces the behavior, and fixes it by replacing the before action with a simple call to @wiki.find_or_new_page(params[:id]) in update.

0001-do-not-lose-submitted-content-when-attempting-to-upd.patch Magnifier (3.35 KB) Jens Krämer, 2019-05-10 07:04

Associated revisions

Revision 18165
Added by Go MAEDA 4 months ago

Do not lose submitted content when attempting to update a wiki page that has been renamed in the meantime (#31334).

Patch by Jens Krämer.

Revision 18166
Added by Go MAEDA 4 months ago

Merged r18165 from trunk to 4.0-stable (#31334).

Revision 18167
Added by Go MAEDA 4 months ago

Merged r18165 from trunk to 3.4-stable (#31334).

History

#1 Updated by Go MAEDA 4 months ago

  • Target version set to Candidate for next minor release

#2 Updated by Go MAEDA 4 months ago

  • Target version changed from Candidate for next minor release to 3.4.11

Setting the target version to 3.4.11.

#3 Updated by Go MAEDA 4 months ago

  • Status changed from New to Needs feedback
  • Assignee set to Jens Krämer

I had to change the name of the class WikiTest in test/integration/wiki_test.rb to run bin/rails test because it conflicts with the class WikiTest in test/unit/wiki_test.rb. I encountered the following error.

/path/to/redmine/test/unit/wiki_test.rb:22:in `<top (required)>': superclass mismatch for class WikiTest (TypeError)

Do you think what class name is appropriate?

#4 Updated by Jens Krämer 4 months ago

Oh well :) What about WikiIntegrationTest?

#5 Updated by Go MAEDA 4 months ago

  • Status changed from Needs feedback to New
  • Assignee deleted (Jens Krämer)

Jens Krämer wrote:

Oh well :) What about WikiIntegrationTest?

Looks nice!

#6 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you for reporting and fixing this issue.

Also available in: Atom PDF