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.
I use this module together smartqueue_language and it looks like nodequeue does not pass the text in the autocomplete texfield to the modules that implements hook_nodequeue_autocomplete.
Here is the patch with my solution to this.
Comment | File | Size | Author |
---|---|---|---|
#18 | 2231793-nodequeue-autocomplete-alter-18.patch | 1.31 KB | fizk |
#16 | nodequeue-autocomplete-alter-2231793.patch | 649 bytes | PatrickScheffer |
#14 | nodequeue-query_add_tag-2231793-14.patch | 1.12 KB | pverrier |
#9 | nodequeue-query_add_tag-2231793-9.patch | 1.13 KB | greggadsdon |
#5 | nodequeue-autocomplete-2231793-5.patch | 563 bytes | kporras07 |
Comments
Comment #1
kporras07 CreditAttribution: kporras07 commentedComment #3
kporras07 CreditAttribution: kporras07 commentednodequeue-autocomplete-does-not-pass-autocomplete-text-to-hook.patch queued for re-testing.
Comment #5
kporras07 CreditAttribution: kporras07 commentedUpdated version of the patch
Comment #6
kporras07 CreditAttribution: kporras07 commentedComment #7
Steven Jones CreditAttribution: Steven Jones commentedComment #8
Steven Jones CreditAttribution: Steven Jones commentedThis code looks like it just comes from Drupal 5 land.
Maybe it should just be updated send the $query object, or just add some tags and then use hook_query_TAG_alter
Comment #9
greggadsdon CreditAttribution: greggadsdon commentedThis patch removes the "hook_nodequeue_autocomplete call and adds the tag "nodequeue_api_autocomplete" to the query which allows other modules to step in with hook_query_TAG_alter() and change the query. $queue and $subqueue are also added to the metadata.
A patch for Smartqueue language with hook_query_TAG_alter() implemented can be found in comment #1 at https://drupal.org/node/2130727.
Comment #10
pverrier CreditAttribution: pverrier commented#9 worked for me, thanks.
Comment #11
KarlSheaPatch in #9 along with patch in smartqueue_language fixed the issue I was having, thanks.
Comment #12
venutip CreditAttribution: venutip commentedConforming that the patch from #9 allows you to modify the autocomplete query using
hook_query_TAG_alter()
.Comment #13
JPHuxley CreditAttribution: JPHuxley commentedTried patch in #9 which worked and allowed me to use hook_query_TAG_alter(), thanks.
Comment #14
pverrier CreditAttribution: pverrier as a volunteer commentedRerolled patch #9 for 7.x-2.x-dev
Comment #15
pverrier CreditAttribution: pverrier as a volunteer commentedCan this patch be commited? Thanks.
Comment #16
PatrickScheffer CreditAttribution: PatrickScheffer commentedAlthough adding a query tag is a nice feature, it didn't fulfill my requirements.
I needed to alter the output text, to be specific: I wanted to append the content type to the result so the user would know what type of content he or she is adding to the nodequeue.
For that I created the enclosed patch.
I've created hook_nodequeue_api_autocomplete which is a direct copy from this function:
This allows us to alter the query AND the results.
Comment #17
fizk CreditAttribution: fizk commentedPerhaps the best of both worlds? This combines #14 and #16.
Comment #18
fizk CreditAttribution: fizk commentedThis patch executes the query before calling hook_nodequeue_api_autocomplete, and passes the query results instead of the query object.
Comment #19
PatrickScheffer CreditAttribution: PatrickScheffer commented@fizk Great idea separating the functions, this allows the user to easily modify either the query or the results. I considered your solution when creating my patch, but in my case I needed to alter both so one function suited me more. Perhaps a little egocentric. :)
Comment #20
Renrhaf+1 for comment #18
Comment #21
fizk CreditAttribution: fizk commented@PatrickScheffer :P
Setting to RTBC from #19 and #20.
Comment #23
fizk CreditAttribution: fizk commentedCommitted, thanks everyone!
Comment #24
RenrhafExcellent, thank you very much !
Any idea if/when this could be available as a tagged release ? :)
Comment #25
fizk CreditAttribution: fizk commented@Renrhaf 7.x-2.1 as of yesterday :-)