Comments (8)
Thank you for opening the issue. Lets take a step back here, and look at what is going on.
Problem:
- hooks in SMF 2.0 were designed to allow multiple actions to be executed at each point in the code.
- a need has appeared, to have a single, unique action executed, at a particular point.
- [constraint] SMF should allow registration of more actions, and fall back to the last registered.
Suggested solution:
- hooks system should allow 'unique actions' (hooks) to be defined
- for 'unique' actions, call_integration_hook() must execute only the last function registered by some mod.
from smf.
@norv that sounds confusing and complicated. Might as well hook the fallback action, too!
from smf.
The way I'd fix this is a much deeper overhaul of hooks in totality. I'd be giving them the ability to define a priority, perhaps on a scale of 1 to 100, 1 first, 100 last, defaulting at 50 (which is basically order of install)
Then once we know what order a hook's listeners are going to be run at, we can fix this issue cleanly; call each in turn, first one hit that's valid is the one we run with. Then it strictly becomes a mod issue when two mods clash and one mod can take a higher priority and determine if it should be having the front page or not, and return either the function name (or whatever) or return false if it doesn't do anything.
The fallback action if no action is matched is not a bad idea but ultimately should require the same thing to be done to make it work properly, and I'm concerned that rethinking the hook system to enable that is now out of practical scope for 2.1.
from smf.
I kinda like Arantor's idea, and also agree this isn't something for 2.1.
from smf.
I've added the fallback being hookable, but beyond the priority, I'm not sure anything can or will be done about it in 2.1... really, well behaved hooks should be returning fall in those situations anyway if they know they're not going to be called. But with some of the other changes added recently adding hook priority is a hurdle to deal with.
from smf.
If this is no longer an issue for 2.1, can we move it to a 3.0 milestone? The milestones really need a cleanup.
from smf.
If it's no longer issue for 2.1 it needs to be closed :)
-----Original Message-----
From: "Ant59" [email protected]
Sent: 29.4.2014 14:00
To: "SimpleMachines/SMF2.1" [email protected]
Subject: Re: [SMF2.1] integrate_default_action (#224)
If this is no longer an issue for 2.1, can we move it to a 3.0 milestone? The milestones really need a cleanup.
—
Reply to this email directly or view it on GitHub.
from smf.
Agreed. That makes better sense with this being a 2.1 repo 👍
from smf.
Related Issues (20)
- `$significant_decimals` generates noise
- [3.0]: Search results are not showing
- `composer lint-fix` doesn't work on windows commandline HOT 3
- `TypeError` in Repair Boards HOT 1
- First line of query gets cut off in query log HOT 1
- $txt['debug_query_which_took_at'] HOT 1
- [2.1] [3.0]: poster_name is member_name (private) not real_name (display)
- [3.0]: Links not rendered in search results
- [3.0]: Custom search index weirdness
- [2.1]: Notication emails for reply not sent if user also subscribe for the board HOT 2
- [3.0]: MariaDB doesn't have "REGEXP_LIKE" HOT 1
- [3.0]: Upgrade doesn't work HOT 2
- [3.0/2.1]: Installing packages/themes does not parse line breaks for the XML tags.
- [3.0]: Upgrade breaks after backup due to User::$me not being initialized
- [3.0]: New columns not being added to tables HOT 1
- [3.0]: Calling pg_version() with default connection is depracated as of PHP 8.1
- [3.0] Installer needs General language file? HOT 17
- [3.0]: Error while adding holidays
- [3.0]: Adding calendar event can cause max_execution_time to be exceeded HOT 3
- [3.0]: No option to delete events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smf.