-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Gambits Management improvement #2306
Comments
Could you please share more details about your use-case so that we can understand why you need this? If we really want to allow this (and currently it just feels like a super rare edge-case), we would probably have to split up the gambit's |
@franzliedke Here are some details: I'm writing an extension that uses discussions as data container for entities that we call reviews (they are connected to a product, in this case a book from a book store. These reviews live alongside of discussions in the forum and I use a gambit to tell the backend to either filter out the regular discussions or the reviews. This work pretty well. Now I'm working on the /following page and there things are getting very tricky... |
Tbh, I feel like the most effective solution would be to just introduce a parallel endpoint for searching reviews, and add it as a search source in the frontend. I don't think we have any provisions for "discussion types" |
Maybe I'll have to consider this. I initially didn't do it with a separate endpoint because I wanted to reuse as much as possible from the discussions, including features that come from extensions. Both roads lead into difficulties and maintenance problems... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. |
We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it. |
Feature Request
I've run into a situation where it would have been really handy to know the list of active Gambits while inside of one of these Gambits. As I found out, the code (usually the
conditions()
method) of the gambits is executed at the same time as the list of active gambits is created in theGambitsManager
. This means if you check for$search->activeGambits()
you'll get[]
...I would propose to make changes to the
GambitManager
(and maybe more if needed) to run a 2-step process that first checks what gambits are active and only then runs their conditions.FYI:
In my case I found a workaround where I would use a Middleware and a Provider to make the current
$request
object available withapp('request')
from anywhere in the code. Having that, I was able to mimic some code of theGambitManager
to check what Gambits are active before the list would get populated.The text was updated successfully, but these errors were encountered: