Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor page saving and introduce COMMON_WIKIPAGE_SAVE #1472

Merged
merged 1 commit into from Feb 24, 2016

Conversation

splitbrain
Copy link
Collaborator

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

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
@scrutinizer-notifier
Copy link

The inspection completed: 2 new issues

splitbrain added a commit that referenced this pull request Feb 24, 2016
refactor page saving and introduce COMMON_WIKIPAGE_SAVE
@splitbrain splitbrain merged commit 2a83ac6 into master Feb 24, 2016
@splitbrain splitbrain deleted the wikisave_event branch February 24, 2016 09:23
@Klap-in
Copy link
Collaborator

Klap-in commented Apr 20, 2016

https://www.dokuwiki.org/devel:event:common_wikipage_save looks complete.
Documentation is done?

@splitbrain
Copy link
Collaborator Author

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants