Menu

#1268 bad hard-coded query: $member_handler->getUserList($criteria)

XOOPS_2.5.x
pending
None
1
2014-01-23
2013-05-07
No

Xoops 2.5.6 and Xoops 2.6 bug:
bad hard-coded query: $member_handler->getUserList($criteria)

See this thread:
http://xoops.org/modules/newbb/viewtopic.php?topic_id=76058

Discussion

  • Richard Griffith

    • status: open --> pending
    • assigned_to: Richard Griffith
     
  • Richard Griffith

    This is a really rough edge in XOOPS. I can see what the patch is trying to accomplish, and why we need to eliminate such an ugly query, but there are some issues.

    The member_handler needs to be clean. Adding exceptions in such a central system handler to handle one specific use case will likely cause problems in other use cases. The only place that we can be sure that a specific call to the handler is really the ugly query is in XoopsFormSelectUser itself. Whatever caching and optimization that is needed must be done there.

    Also, the proposed solution is weak in a multi-user sense. While the XoopsFormSelectUser is often used in an administration environment, it is also used in user functions, such as private messaging. One shared MRU (most recently used) cache means that an admin's recent changes will be overwritten by users that pm a lot, and vice versa. That kind of caching needs to be user specific.

    The user interface for the XoopsFormSelectUser is awkward. I would prefer to see something with an ajax autocomplete system, perhaps based on something like this: http://ivaynberg.github.io/select2/ . We could add a per-user MRU list, either with persistent cache or simply session storage. However, that would be a radical change for the 2.5.7 release. 2.6.0 will provide a better base for such a solution.

    For now, we will use statics to cache the ugly query and the user count query inside the form function, so that it will only run once in a given page request. Also, drop from 200 to 100 entries. This is only a small step, but it is an improvement.

     

Log in to post a comment.