Uploaded image for project: 'Lucee Development'
  1. LDEV-1294

query.sort() should return a new query, not adjust the original query

    Details

    • Type: Bug
    • Status: Backlog
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.1.4.18
    • Fix Version/s: None
    • Labels:
      None
    • Sprint:

      Description

      See http://blog.adamcameron.me/2017/04/cfml-lucee-13-v-4-14-v-6-coldfusion-we.html

      The member function Query.sort() should not modify the original query, it should return a new sorted query. It makes sense for the function version of this - querySort - to adjust the query inline, but it doesn't make sense for it to do this with the member functions.

      If Lucee followed ColdFusion here and the member function returned a pointless boolean then it'd make sense to change the source object, but that's not how your sort member function has been implemented.

      I guess it could be legit to say that changing the original query is purposeful "sideways compat" with CF, and the fact that it also returns the same query is just a "bonus" for Lucee devs (cos that's how CF shoulda done it in the first place). If so... feel free to just close this as "nah, not worth it".

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              da_cameron Adam Cameron
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: