[PR #134] [MERGED] Hook rewrite return value #289

Closed
opened 2026-02-26 10:30:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/opensolutions/ViMbAdmin/pull/134
Author: @mfechner
Created: 3/24/2015
Status: Merged
Merged: 4/2/2016
Merged by: @barryo

Base: masterHead: hook_rewrite_return_value


📝 Commits (4)

  • 3a0e58e Added the possibility that a plugin function can stop the workflow if it return a false.
  • 13120a8 If an alias is deleted, continue only, if all called hooks from all plugins give green light to continue with the deletion.
  • d4f2fd6 A not existing hook function in a plugin will always cause a true return value to not break interrupt flow.
  • b65ac65 Make sure the toggle function for the alias return the correct value to return error message to user why a alias could not be deactivated.

📊 Changes

3 files changed (+37 additions, -25 deletions)

View changed files

📝 application/controllers/AliasController.php (+28 -23)
📝 library/ViMbAdmin/Controller/PluginAction.php (+8 -2)
📝 library/ViMbAdmin/Plugin.php (+1 -0)

📄 Description

I required the functionality to implement checks in plugins.
These checks must be able to forbid core to write values into the database.
As this logic is part of the plugin the hook system must be able to handle return values.

With these modifications the called hooks can return a false value and therefor are able to inform core to not execute the triggered action, but display an error message.

Would be nice if this could be merged into the repository.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/opensolutions/ViMbAdmin/pull/134 **Author:** [@mfechner](https://github.com/mfechner) **Created:** 3/24/2015 **Status:** ✅ Merged **Merged:** 4/2/2016 **Merged by:** [@barryo](https://github.com/barryo) **Base:** `master` ← **Head:** `hook_rewrite_return_value` --- ### 📝 Commits (4) - [`3a0e58e`](https://github.com/opensolutions/ViMbAdmin/commit/3a0e58e49824c31a03e2d85f83df4c73544de1b8) Added the possibility that a plugin function can stop the workflow if it return a false. - [`13120a8`](https://github.com/opensolutions/ViMbAdmin/commit/13120a822832370ba52acdb1a347f7259b6c1661) If an alias is deleted, continue only, if all called hooks from all plugins give green light to continue with the deletion. - [`d4f2fd6`](https://github.com/opensolutions/ViMbAdmin/commit/d4f2fd6eb3d85a506bdb1f0c0523de973325e67a) A not existing hook function in a plugin will always cause a true return value to not break interrupt flow. - [`b65ac65`](https://github.com/opensolutions/ViMbAdmin/commit/b65ac654adefec7b4c615f80887c1424ba3bbfce) Make sure the toggle function for the alias return the correct value to return error message to user why a alias could not be deactivated. ### 📊 Changes **3 files changed** (+37 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `application/controllers/AliasController.php` (+28 -23) 📝 `library/ViMbAdmin/Controller/PluginAction.php` (+8 -2) 📝 `library/ViMbAdmin/Plugin.php` (+1 -0) </details> ### 📄 Description I required the functionality to implement checks in plugins. These checks must be able to forbid core to write values into the database. As this logic is part of the plugin the hook system must be able to handle return values. With these modifications the called hooks can return a false value and therefor are able to inform core to not execute the triggered action, but display an error message. Would be nice if this could be merged into the repository. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 10:30:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#289
No description provided.