Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Please support autocomplete in Views exposed filters for nodereferences. Currently nodereference exposed filters are either a dropdown or multiselect. Either way is painfully difficult if you have a huge list of candidates, especially when sorting needs don't result in a data list that works well with either kind of selector.
Comment | File | Size | Author |
---|---|---|---|
#36 | 506654-36.patch | 15.58 KB | jide |
#29 | 506654-29.patch | 15.77 KB | roderik |
#28 | 506654.patch | 15.79 KB | roderik |
#11 | 506654-11.filter-overview.png | 13.27 KB | dww |
#11 | 506654-11.filter-gear-configuration.png | 18.42 KB | dww |
Comments
Comment #1
yngvewb CreditAttribution: yngvewb commentedI agree, the autocomplete widget in node reference is not reflected in exposed filter in views. This makes nodereference filters painfull to use...
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedI'm afraid this will be falling down the queue unless someone can come up with a patch for review. Postponing until that happens.
Comment #3
davidneedham+1
Want
Comment #4
lorcon CreditAttribution: lorcon commentedSubscribing....
Comment #5
dimiduj CreditAttribution: dimiduj commentedSuscribing too ...
Comment #6
cdale CreditAttribution: cdale commentedI've rolled a patch that does this. Seems to work for me for both user and node reference, although I have not extensively tested.
I've also added the ability to select multiple nodes in the one node reference widget the same way as taxonomy auto-complete by comma separating values. This only works when "force single" is unchecked.
Not 100% sure on the approach I've taken, so reviews appreciated.
Comment #7
cdale CreditAttribution: cdale commentedComment #8
marty.true CreditAttribution: marty.true commentedI've added your patch but I don't see how to choose an autocomplete widget in my exposed filter. My node reference field is an autocomplete but even after applying your patch, I see no way to get rid of the select list in my exposed filter in Views.
Comment #9
cdale CreditAttribution: cdale commentedIf the patch is working correctly, it should be the first option you choose when creating a new nodereference filter. I can't explain it any better, as I'm not sure exactly what it's called. It's one of the base options, not one of the extra options. Can you see the choice when creating a new nodereference filter?
Comment #10
level09 CreditAttribution: level09 commented+1 Important feature !
Comment #11
dwwQuick note: although I haven't closely reviewed the code (and I must admit I'm much more familiar with the internals of Views than CCK), I tested patch #6 on a site with Views 6.x-2.7 and CCK 6.x-2.6 and it appears to work beautifully. Here are some screenshots of the patch in action on an admin view I created to do advanced filtering of products on a bookstore site I'm working on. The author, editor and foreword fields are all node references to person nodes that represent authors and such. First two are shots of editing the view -- you see the overview of the filters and now the noderef filters have the gear icon to configure them. Then you see what you get when you click the gear -- a choice of exposed filter widget type. Then are two shots of the actual view -- what you see when you first load the page and once you auto-complete an author name and apply the filter. Before, this page was a bit painful to load (and use) with giant select boxes with close to 1000 options in them. Now, it's nice and snappy and much more usable. Yay!
Comment #12
bfr CreditAttribution: bfr commentedDoes not return any names for me.. could it be because i'm using the realname module?
Comment #13
redben CreditAttribution: redben commentedsubscribe
Comment #14
Aren Cambre CreditAttribution: Aren Cambre commentedPutting back to active. I don't think it should be needs review because there's no patch to review, and not postponed because there's nothing else blocking progress on this issue besides finding someone with time. I think active is the appropriate status until something changes.
Comment #15
cdale CreditAttribution: cdale commentedThere's a patch for review in #6, which has been reviewed in #11. So I think needs review is the correct status, as there is a patch.
Comment #16
domidc CreditAttribution: domidc commentedCant we move this into a seperate module? I dont like patching cck for this.
Comment #17
Aren Cambre CreditAttribution: Aren Cambre commented@domidc: I agree. Please see #690478: Maintainer needed for D7 versions of nodereference / userreference.
Comment #18
introfini CreditAttribution: introfini commentedsubscribing
Comment #19
endiku CreditAttribution: endiku commentedSubscribing
Comment #20
Alan D. CreditAttribution: Alan D. commented+1 for CCK core for Drupal 6 for this issue.
#690478: Maintainer needed for D7 versions of nodereference / userreference suggests that there would be more work in the long run if this was moved out into a seperate module. I strongly think that this feature should be part of the core NodeReference / UserReference module (in Drupal 7) where ever the base modules reside. Anyone want an exposed filter on 100,000 nodes?
Seperating it here means trying to merge two seperate modules latter on, this seems like a lot more work than simply adding the feature before starting to seperate out the node / user reference functionality. So maybe this should be applied to 7.x-2.x-dev ASAP and back ported to 6.x-(2/3).x first?
Anyway this was just my 2 cents before going off to try and find a way to do this without having to hack a major module.
Comment #21
sotiris CreditAttribution: sotiris commentedSubscribing
Comment #22
Aren Cambre CreditAttribution: Aren Cambre commented@Alan D.--the point of #690478: Maintainer needed for D7 versions of nodereference / userreference is that there are no core node/userreference modules. So seems this would have to be implemented in the contrib module.
Huh? Don't see what that has to do with core vs. contrib.
Comment #23
Alan D. CreditAttribution: Alan D. commented@Aren Remember the 250,000 + Drupal 6 users and D7 is at least 4? months away. Have these already been taken out? That references is only a uncommented task so it is difficult to see what the road map here.
To get this in D6, then you are suggesting.
Split D7 fields, implement the feature, backport into D6? Timeline - 2 months, 4 months, never? This seems harder than just implementing now then everything is in place as the new contrib module is split out latter. Just my 2c
The "Anyone want an exposed filter on 100,000 nodes?" is just a reason for the need, nothing else. The project we are doing currently has 5 different fields that are going to need some form of widget that can handle this, each having > 10,000 references. Having a seperate module that implements a single field widget is not the best path IMHO (I've gone down that path many times - things break and code is duplicated), but either a series of processing callbacks or a new contrib module appears to be the only path forward at the moment, (we try to avoid hacking modules).
Comment #24
roderiksubscribing
Comment #25
Aren Cambre CreditAttribution: Aren Cambre commentedThis may be getting too philosophical, but putting new features in the latest branch first is the safest way of doing things. Worst case scenario is the feature doesn't get backported to old versions, and that is a minor problem because you can always upgrade.
Comment #26
Alex Andrascu CreditAttribution: Alex Andrascu commented+1 subscribing
Comment #27
ManyNancy CreditAttribution: ManyNancy commentedDoes this apply to CCK3?
Comment #28
roderikThe patch in #6 has one nasty little bug (typo) in userreference_autocomplete_value, which breaks userreferences without an assigned view.
Changed '$nids =' to '$uids =' on one line. The rest is the same; all credit for the patch still goes to cdale.
Comment #29
roderikOops, some more bugginess in userreference_autocomplete_value(). You don't want a db_rewrite_sql() on a user query.
Comment #30
patcon CreditAttribution: patcon commentedSo... no commit-love on this?
Comment #31
ManyNancy CreditAttribution: ManyNancy commentedYes please.
Comment #32
azinck CreditAttribution: azinck commentedsubscribed
Comment #33
kevinsiji CreditAttribution: kevinsiji commentedFriends, anybody else tested the patch in #29? It seems to work fine in my test server. Anyway I'm not php expert to evaluate the code, hence I request developers to confirm if this patch can be used (when time permits).
I don't expect my site to be upgraded to Drupal-7 in the immediate future, and if this patch is not going to get committed, I have to opt to patch my installation.
Would like to have some opinion about this.
Comment #34
jldos CreditAttribution: jldos commentedWork for me!
Thanks
Comment #35
miaoulafrite CreditAttribution: miaoulafrite commentedSubscribing
this is a so cool feature, is there any way to include it into the next release of CCK?
Comment #36
jide CreditAttribution: jide commentedJust corrected the paths in the patch for it to apply correctly from drush make.
Comment #37
deciphur CreditAttribution: deciphur commentedWhen I use auto-complete with any titles that have special characters, the patch in #29 goes crazy. [Found no valid post with that title]
Anybody else having this issue?
Comment #38
blakehall CreditAttribution: blakehall commented+1 here. The patch in #36 appears to be working for me
Comment #39
flyboynomad CreditAttribution: flyboynomad commentedsub
Comment #40
Alan D. CreditAttribution: Alan D. commentedLets get this moving...
Someone should volunteer for #690478: Maintainer needed for D7 versions of nodereference / userreference and get this puppy in. Then maybe we can get a back-port!
I'd volunteer myself, but I'm on holiday for the next 6 months ;)
Comment #41
aiwata55 CreditAttribution: aiwata55 commentedsubscribe
Comment #42
gstout CreditAttribution: gstout commented+1 subscribe
Comment #43
mstrelan CreditAttribution: mstrelan commented#36 works great EXCEPT if you uncheck "Force single"
Comment #44
Aren Cambre CreditAttribution: Aren Cambre commentedper #43
Comment #45
Magnus CreditAttribution: Magnus commentedSubscribe
Comment #46
fgmnodereference and userreference for Drupal 7.x are now maintained separately in the References module: moving issue over there.
Comment #47
gstout CreditAttribution: gstout commentedUm, Since I have dozens of drupal 6 sites how about if we leave this issue here too?
Comment #48
dww@gstout: I think the idea is to fix it in D7's references module first, then backport it to D6 (if possible). That's the (often annoying and pointless) workflow that the rest of the community (and core itself) follows. The concept is that it prevents regressions where something is fixed or added in an earlier version which doesn't work or exist in the newer version. In practice, it often means that working code sits in the queue for months or years, especially since the people trying to fix something need it working in the version of core they're using, not some future version they might not be using for another year or more...
Comment #49
patcon CreditAttribution: patcon commentedI use D6 exclusively as well, but in favour of D7 momentum, I'm for keeping it tagged as-is.
Comment #50
fgmCategorizing.
Comment #51
arojoal CreditAttribution: arojoal commented+1
Comment #52
scottatdrake CreditAttribution: scottatdrake commentedSubscribing. Hoping for a D6 version sometime.
Comment #53
sinasalek CreditAttribution: sinasalek commentedsubscribing
Comment #54
AgaPe CreditAttribution: AgaPe commentedhoping for this for D7
Comment #55
Isostar CreditAttribution: Isostar commented+1
Comment #56
verres CreditAttribution: verres commentedsubscribing - but hoping for backport to D6
Comment #57
xlyz CreditAttribution: xlyz commentedsubscribing
Comment #58
presleyd CreditAttribution: presleyd commentedThe patch in 36 is missing an 's' on line 326 such that {user} should be {users}, the patch is working on CCK 3.x for Drupal 6 as well. I haven't opened the references module code at all yet. How much does it differ from the old CCK implementation?
Comment #59
spacereactor CreditAttribution: spacereactor commentedsubscribing
Comment #60
bsandor CreditAttribution: bsandor commentedsubscribing
Comment #61
marcoka CreditAttribution: marcoka commentedi am a little bit confused. is it avaliable in d7 dev version or not?
Comment #62
TechNikh CreditAttribution: TechNikh commentedthis has to be a part of http://drupal.org/project/views_autocomplete_filters
Comment #63
blackspiraldancer CreditAttribution: blackspiraldancer commented+1, totally agree
Comment #64
johnnyfofo CreditAttribution: johnnyfofo commentedI agree with TechNikh #62 (though it doesn't work like that, yet), but also think this should just be out of the box in both References and CCK.
Comment #65
ndvo CreditAttribution: ndvo commentedOne can implement this with views autocomplete filters module (http://drupal.org/project/views_autocomplete_filters).
Create a relation to the node reference field and use the node title exposed filter using the relation.
Use the "contains" filter.
Comment #66
hgneng CreditAttribution: hgneng commented#65 works perfectly for me! Thanks!
Comment #67
Aren Cambre CreditAttribution: Aren Cambre commentedPer #65.
Comment #68
bfr CreditAttribution: bfr commented