Skip to content
Snippets Groups Projects
Commit b24d9195 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

refactor page saving and introduce COMMON_WIKIPAGE_SAVE

This makes the saveWikiText() function a little easier to read and moves
external edit handling to its own function. Behavior stays the same
(tests are unchanged).

In addition a new event COMMON_WIKIPAGE_SAVE is introduced that makes
intercepting and acting on page saves much easier than possible before.

Developers can:

* prevent saves by either preventing the default action or overwriting
  the contentChanged field in a BEFORE hook
* enforce saves even when no content changed by overwriting the
  contentChanged field in a BEFORE hook
* Adjust the saved content by modifying the newContent field in a BEFORE
  hook
* Adjust the stored change log information (summary, type, extras) in an
  AFTER hook
* Easily know if a page was deleted, created or edited by inspecting the
  changeType field
* what ever they want before or after a wiki page is saved
parent 023953f0
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment