Hey jeremy,

when viewing a ticket list for any given client, the autoassign field did not return any user suggestions when entering text.

After debugging your code I was able to solve it by changing the following:

// File: support.module
// Function: support_page_form()
// Line: around 2550 (within the while loop)
        $form['assigned']["assigned-$ticket->nid"] = array(
          '#type' => 'textfield',
         '#autocomplete_path' => 'support/autocomplete/assigned/'. $ticket->client,
          '#default_value' => $assigned,
          '#size' => '15',
          '#attributes' => array('class' => 'ticket-assigned'),
        );

into the following: (changed $ticket->client into $client)

        $form['assigned']["assigned-$ticket->nid"] = array(
          '#type' => 'textfield',
         '#autocomplete_path' => 'support/autocomplete/assigned/'. $client,
          '#default_value' => $assigned,
          '#size' => '15',
          '#attributes' => array('class' => 'ticket-assigned'),
        );

I dsm'ed the ticket object, but it never contains a client property. Can you confirm this is a bug (cause after this change everything seems to work as expected)?

Comments

ledom’s picture

Hi,

What about this? I just install last dev version and autocomplete does not seems to work at all, into admin pages (auto-assign, auto-subscribe), support page (list all tickets) or ticket page.

Entering part of a user name does not show user suggestion.

Looking at console show:
GET http://www.mysite.com/support/autocomplete/assigned/1/max
result: [ ]

ledom’s picture

First point: autocomplete does not work on admin page and ticket page

Solved with giving Acces MYCLIENT client permission to role. If a user is
Authenticated user and Role1 role, to give Authenticated user permission to acces client does not allow to get this user into suggestion box. Using Role1 works fine.

Second point: no suggestion on support page (list all tickets)
Solved by modifying following line
'#autocomplete_path' => 'support/autocomplete/assigned/'. $client,

else the get request was
GET http://www.mysite.com/support/autocomplete/assigned//max
with double slash and return nothing.

Maybe it would be good to commit this, no?

jeremy’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Patch (to be ported)

Sorry for the delay on committing a fix; I didn't understand the original report. I see now that the issue is with the multi-ticket views.

Fixed in 6.x here:
http://drupalcode.org/project/support.git/commit/8635307

jeremy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Fixed

This is already fixed in the 7.x branch.

Status: Fixed » Closed (fixed)

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