-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Search by Comment ID #1
Comments
The comment model is already setup to give you the info you need: so to get the Task ID from a Comment ID, call the model and ask for the task id. It makes more sense when you setup a variable first:
|
after looking at your code, in order for this to work, you are going to need to approach this different. there isn't a way to interpret the user input of that comment id, and then send user to task page. you are trying to do it all on the front end, but there is no back end for it. I can tell you how to get the data you want, but you need a backend for the form data. easiest way to do it, would be extend the TaskViewController with your own function to take the comment id input, and then get the task id, and send user to page. |
haha Im a front end guy thats why.... right well all the above just went way over my head... so I will keep crawling on it. |
do you mean as a helper or as a controller? |
a controller |
Is the rest of the code (for comments) okay in the form? am I just missing a controller now to (link a comment id to a task and go to it)? |
im almost done, give me a few minutes. |
ah crap, you pushed something while i was working on it ;p |
oh so sorry, I didnt know you were working on it... i just pushed that suggested variable you suggested... i wont touch it now.... didnt realise you were on it. |
and I lost the controller i wrote trying to merge....i suck at git apparently... |
ok, done. |
oh damn... excellent bugger, thanks so much I will test shortly.... big thanks on this as my head was fully baffled for ages on it |
only thing I didn't test was what will happen if you put a bad comment id in it...I'll leave that to you, pretty sure something bad would happen. it's late, I'm going to bed, and waking up early to shoot birds. you got this from here! |
this is fantastic it works! a very big thanks for this! |
it gives a white blank page... also, there is no pretty url or even jumping direct to the comment (like in notifications)... is that by coding or is it a limit because its a plugin? (asking looking at the url) |
if my memory serves me correct, you need to setup a route, for a pretty url. that might go over your head. you can default to the dashboard in the controller if a bad id is input. |
this should give you more detail on what that route should look like: |
great thanks, I will checkout routes later tonight when I am able to test |
Fixed in fef769b |
Filters have stopped working with this new controller.
I've had to disable the plugin for now
From: ***@***.***
Sent: 31 October 2022 04:21
To: ***@***.***
Reply to: ***@***.***
Cc: ***@***.***; ***@***.***
Subject: Re: [aljawaid/Glancer] Search by Comment ID (Issue #1)
example of a route:
https://github.com/creecros/Customizer/blob/8ff94950eda0ac22a2aece9590263da4949884bc/Plugin.php#L106
—
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOCO3C3LYQMRDZ2NKXLDLTWF5CMVANCNFSM6AAAAAARNX43RU>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
working fine for me, you need to be more descriptive. Also, the controller does not interfere with filters in anyway, the only thing that uses that controller is your layout template. Period. |
Try it here |
Anyhow, I setup a route for the search by comment id. Took a bit for me to figure out how to get the task_id into the params to send to the controller and pull that variable before routing, but I figured it out. inorder to prettify your other search fields, task id and project id, the only way I know how to do it, would be going through a controller. Unless you can figure out how to build the url for a premade route, that might work. |
I did and the plugin itself works but then when you go to the board and do a closed tasks filter or any filter, it comes up with this: the result url in the browser is: |
should be all set now. it was the location of the template hook. moved to top, and all seems well now. everything else should be sorted as well, pretty urls and no blank pages, instead "Sorry, I didn't find this information in my database!" message if there is no comment id, etc... |
Thats great, I'm excited to release the first version soon.... this has just become such a productive tool with any user being able to search by task, comment or project. Big thanks to you! |
Can anybody help with how to find the comment ID and display the associated task? I've tried a few different ways, one is below, but nothing seems to work.
The text was updated successfully, but these errors were encountered: