This replaces the participant filter select element with an autocomplete.

This is a first patch, code is still a bit ugly and undocumented but it seems to work fine.

It is a bit complicated with all those conversions going on in privatemsg_filter, we should try to simplify that, if possible. Probably not as part of that patch, though..

Comments

naheemsays’s picture

Status: Needs work » Needs review

Is it possible to make this a checkbox option? the textfield by default, but if checked, use the old method of showing the full list? Or would that make things a little too complicated?

I have tested this patch many times and it seems to work well, but leaving at cnr for now as the original post mentions adding more comments.

naheemsays’s picture

Status: Needs review » Needs work

Actually, this no longer applies.

Also:

+  list($messages['recipients'], $invalid) = _privatemsg_parse_userstring($form_state['values']['recipients']);

should be

+  list($message['recipients'], $invalid) = _privatemsg_parse_userstring($form_state['values']['recipient']);

Otherwise sending new messages breaks. (remove the two extra s's)

berdir’s picture

StatusFileSize
new7.87 KB

Rerolled, thanks for catching the typos...

naheemsays’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected and the noted problems have been fixed.

EDIT - If there was one niggle, I would have the sql and the sql_alter functions documented. I always need to find what calls them to see what their purpose is... but that can be done separately en masse for all the others too.

litwol’s picture

Status: Reviewed & tested by the community » Needs work

as per nbz's "EDIT - ..."

naheemsays’s picture

I think it would be good to return this to rtbc, and cover the sql functions all in one go. I have created #454832: Document sql query definitions. as an all in one issue queue - but I will leave the status of this as is to let litwol decide.

litwol’s picture

Despite the fact that i advocate smaller patches, that does not always apply to documentation. It besides many other benefits, it also helps me review patches better/faster when there's an abundancy of documentation.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new7.99 KB

Added a apidoc comment to the sql alter function and re-rolled the patch..

berdir’s picture

StatusFileSize
new8.15 KB

Wrong patch, re-introduced old bugs...

Let's try again...

naheemsays’s picture

Status: Needs review » Reviewed & tested by the community

Works, documentation added.

litwol’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.76 KB

Minor change on line 324 in privatemsg_filter

from

       $string .= $author->name . ', ';

to

      $string = isset($string)? $string . $author->name . ', ' : $author->name . ', ';

On first loop $string does not exist and it throws a notice.

Friendly reminder everyone to turn on your php E_NOTICE & $_ALL when developing.

berdir’s picture

StatusFileSize
new8.21 KB

Above patch missed a space before ? and I think is easier to initialize $string properly.

naheemsays’s picture

Status: Needs review » Reviewed & tested by the community

works as expected (the fix in patch 5 is different to the one proposed in patch 4, but should work as well if not better as a condition is not being evaluated on every roll of a loop).

litwol’s picture

Status: Reviewed & tested by the community » Fixed

Voila ;)

Status: Fixed » Closed (fixed)

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