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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yngvewb’s picture

Component: nodereference.module » Views Integration

I agree, the autocomplete widget in node reference is not reflected in exposed filter in views. This makes nodereference filters painfull to use...

markus_petrux’s picture

Status: Active » Postponed

I'm afraid this will be falling down the queue unless someone can come up with a patch for review. Postponing until that happens.

davidneedham’s picture

+1

Want

lorcon’s picture

Subscribing....

dimiduj’s picture

Suscribing too ...

cdale’s picture

I'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.

cdale’s picture

Status: Postponed » Needs review
marty.true’s picture

I'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.

cdale’s picture

If 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?

level09’s picture

+1 Important feature !

dww’s picture

Quick 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!

bfr’s picture

Does not return any names for me.. could it be because i'm using the realname module?

redben’s picture

subscribe

Aren Cambre’s picture

Status: Needs review » Active

Putting 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.

cdale’s picture

Status: Active » Needs review

There'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.

domidc’s picture

Cant we move this into a seperate module? I dont like patching cck for this.

Aren Cambre’s picture

introfini’s picture

subscribing

endiku’s picture

Subscribing

Alan D.’s picture

+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.

sotiris’s picture

Subscribing

Aren Cambre’s picture

@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.

Anyone want an exposed filter on 100,000 nodes?

Huh? Don't see what that has to do with core vs. contrib.

Alan D.’s picture

@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).

roderik’s picture

subscribing

Aren Cambre’s picture

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

This 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.

Alex Andrascu’s picture

+1 subscribing

ManyNancy’s picture

Does this apply to CCK3?

roderik’s picture

FileSize
15.79 KB

The 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.

roderik’s picture

FileSize
15.77 KB

Oops, some more bugginess in userreference_autocomplete_value(). You don't want a db_rewrite_sql() on a user query.

patcon’s picture

So... no commit-love on this?

ManyNancy’s picture

Yes please.

azinck’s picture

subscribed

kevinsiji’s picture

Friends, 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.

jldos’s picture

Work for me!
Thanks

miaoulafrite’s picture

Subscribing
this is a so cool feature, is there any way to include it into the next release of CCK?

jide’s picture

FileSize
15.58 KB

Just corrected the paths in the patch for it to apply correctly from drush make.

deciphur’s picture

When 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?

blakehall’s picture

+1 here. The patch in #36 appears to be working for me

flyboynomad’s picture

sub

Alan D.’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Component: Views Integration » nodereference.module

Lets 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 ;)

aiwata55’s picture

subscribe

gstout’s picture

+1 subscribe

mstrelan’s picture

#36 works great EXCEPT if you uncheck "Force single"

Aren Cambre’s picture

Status: Needs review » Needs work

per #43

Magnus’s picture

Subscribe

fgm’s picture

Project: Content Construction Kit (CCK) » References
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: nodereference.module » Code

nodereference and userreference for Drupal 7.x are now maintained separately in the References module: moving issue over there.

gstout’s picture

Um, Since I have dozens of drupal 6 sites how about if we leave this issue here too?

dww’s picture

@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...

patcon’s picture

I use D6 exclusively as well, but in favour of D7 momentum, I'm for keeping it tagged as-is.

fgm’s picture

Component: Code » Code: node_reference

Categorizing.

arojoal’s picture

+1

scottatdrake’s picture

Subscribing. Hoping for a D6 version sometime.

sinasalek’s picture

subscribing

AgaPe’s picture

hoping for this for D7

Isostar’s picture

+1

verres’s picture

subscribing - but hoping for backport to D6

xlyz’s picture

subscribing

presleyd’s picture

The 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?

spacereactor’s picture

subscribing

bsandor’s picture

subscribing

marcoka’s picture

i am a little bit confused. is it avaliable in d7 dev version or not?

TechNikh’s picture

blackspiraldancer’s picture

+1, totally agree

johnnyfofo’s picture

I 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.

ndvo’s picture

One 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.

hgneng’s picture

#65 works perfectly for me! Thanks!

Aren Cambre’s picture

Status: Needs work » Closed (duplicate)

Per #65.

bfr’s picture

Status: Closed (duplicate) » Closed (won't fix)