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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kporras07’s picture

Status: Active » Needs review

Status: Needs review » Needs work
kporras07’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
kporras07’s picture

Updated version of the patch

kporras07’s picture

Status: Needs work » Needs review
Steven Jones’s picture

Steven Jones’s picture

This 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

greggadsdon’s picture

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

pverrier’s picture

#9 worked for me, thanks.

KarlShea’s picture

Patch in #9 along with patch in smartqueue_language fixed the issue I was having, thanks.

venutip’s picture

Conforming that the patch from #9 allows you to modify the autocomplete query using hook_query_TAG_alter().

JPHuxley’s picture

Tried patch in #9 which worked and allowed me to use hook_query_TAG_alter(), thanks.

pverrier’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
FileSize
1.12 KB

Rerolled patch #9 for 7.x-2.x-dev

pverrier’s picture

Status: Needs review » Reviewed & tested by the community

Can this patch be commited? Thanks.

PatrickScheffer’s picture

Although 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:

$function = $queue->owner . "_nodequeue_autocomplete";
if (function_exists($function)) {
  return $function($queue, $subqueue, $string, $query);
}

This allows us to alter the query AND the results.

fizk’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.31 KB

Perhaps the best of both worlds? This combines #14 and #16.

fizk’s picture

FileSize
1.31 KB

This patch executes the query before calling hook_nodequeue_api_autocomplete, and passes the query results instead of the query object.

PatrickScheffer’s picture

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

Renrhaf’s picture

+1 for comment #18

fizk’s picture

Status: Needs review » Reviewed & tested by the community

@PatrickScheffer :P

Setting to RTBC from #19 and #20.

  • fizk committed 8146322 on 7.x-2.x
    Issue #2231793 by kporras07, fizk, pverrier, PatrickScheffer,...
fizk’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks everyone!

Renrhaf’s picture

Excellent, thank you very much !
Any idea if/when this could be available as a tagged release ? :)

fizk’s picture

@Renrhaf 7.x-2.1 as of yesterday :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.