EFForg / org.eff.optimizedautocomplete

CiviCRM extension: Optimize the autocomplete search box mysql queries so they're more efficient on large databases
4 stars 9 forks source link

Excessive notices with CiviCRM 4.6.25, disabled #4

Open joemcl opened 7 years ago

joemcl commented 7 years ago

We've been running this extension successfully for about 4 years but we recently discovered that it causes excessive notices with Civi 4.6.25, so we have just disabled it. Seems to be eg a set of 3 warnings regarding lines 14, 15 and 16 respectively each time we used Quick Search.

petednz commented 7 years ago

Being pedantic here. it is a Notice, not an Error.

Notice: Undefined index: context in optimizedautocomplete_civicrm_contactListQuery() (line 16 of xxx/sites/default/civicrm/extensions/org.eff.optimizedautocomplete/optimizedautocomplete.php).

joemcl commented 7 years ago

Thanks Pete, just updated to Notice from Errors.

xurizaemon commented 7 years ago

So the issue is pretty simple - if $ids is empty at line 89 of optimizedautocomplete.php, it's going to generate invalid SQL.

SELECT id, sort_name FROM civicrm_contact WHERE id IN (  ) ORDER BY sort_name
xurizaemon commented 7 years ago

See fuzionnz/org.eff.optimizedautocomplete@fce6bc95a2 - happy to submit a PR which doesn't contain the other work by @nganivet @edzelopez @joemurray etc if you're actively maintaining this extension still and want a "clean" PR submitted.

xurizaemon commented 7 years ago

Apparently this extension is basically in core CiviCRM now, and shouldn't be used. Yay! I'd close this if I could.

Edzelopez commented 7 years ago

Thanks @xurizaemon, we are however not using this extension anymore. Glad to know it's part of core now!