#6116 closed defect (bug) (fixed)
Message ajax search not working
Reported by: | johnjamesjacoby | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Messages | Keywords: | has-patch |
Cc: |
Description
Searching inbox and sentbox for messages no longer returns anticipated results. Instead it returns results as if no search string were passed.
Attachments (3)
Change History (18)
#3
@
10 years ago
r5822 looks fine, but not seeing the changeset where the input
was pulled out of the label
. Maybe this just happened as part of the bp-legacy
move?
#4
follow-up:
↓ 8
@
10 years ago
#5
@
10 years ago
Noticed this issue yesterday when running through messages and adding that filter, meant to mention/ticket it but got lost in the moment.
I'll apply the patch and test in a minute.
#6
@
10 years ago
Tested -02 patch which appears to work fine search returns correctly now. I have a problem though in having to filter this markup to add additional elements for styling, while retaining unchanged the original form markup and tokens however with that filtered in the search is again broken, so possibly the JS selectors are too specific i.e is a direct child of something or - and I have a suspicion that filtering these search functions might be upsetting Ajax somehow? Looking into what is going wrong currently with my markup.
#7
follow-up:
↓ 9
@
10 years ago
So my particular problem is in having to use the 'button' element; in our initial check we test for 'type' === 'submit' I've added a check for 'button' and tested as working.
Patch uploaded.
#8
in reply to:
↑ 4
@
10 years ago
Replying to r-a-y:
r9240 broke this to address #6010.
For the patch, I would suggest
jq('#messages_search').val()
instead oftarget.parent().children('input[type="text"]').val()
.
This makes more sense to me. I don't love the idea of making a bunch of assumptions about random ID's in the DOM, but it does work, is the fastest, and mirrors our existing JS approaches elsewhere.
Tangentially, anyone want to create a ticket to come up with a DOM element ID paradigm we should be adhering to and cleaning up existing code against?
#9
in reply to:
↑ 7
@
10 years ago
Replying to hnla:
So my particular problem is in having to use the 'button' element; in our initial check we test for 'type' === 'submit' I've added a check for 'button' and tested as working.
Patch uploaded.
I like the idea of checking for button
also. We should be using the button
element more for our forms where literal buttons are the norm.
#10
@
10 years ago
- Keywords 2nd-opinion removed
03.patch
is good to go in my eyes.
Thanks for testing, hnla, and for your button
check addition.
#11
@
10 years ago
This makes more sense to me. I don't love the idea of making a bunch of assumptions about random ID's in the DOM, but it does work, is the fastest, and mirrors our existing JS approaches elsewhere.
We did do a lot of work trawling through the file removing many vague 'have a look around and gather up any tokens you might find' .parent approaches in favour of .closest and also removed a tonne of too strictly binding selectors and tokens, problem with .parent is it has to traverse all the way to the top of the DOM then cache the whole damned lot so is hugely expensive.
#12
@
10 years ago
- Owner set to johnjamesjacoby
- Resolution set to fixed
- Status changed from new to closed
In 9353:
#14
@
9 years ago
Hi!
Any one can help on ajax search message issue?
I have the updated code but the ajax is returning all the messages. The text that i have to search is not working.
Thanks
#15
@
9 years ago
@vizzweb You'll be best off opening a support thread in the BP forums (if you haven't already), and provide a lot more detail about your setup and how your are searching or have updated - this is a close trac ticket so won't receive a lot of attention.
If it does prove to be an issue with messaging we'll open a new trac ticket to address the issue.
Looks like the markup in
bp_message_search_form()
either changed before 2012, or was never correct and this never worked via ajax like #3993 and r5822 conveyed.