neokoenig / RoomBooking

This is an open source application for booking rooms via a web based calendar, using cfWheels, Bootstrap3, jQuery, FullCalendar.js, and other bits. AKA the OxAlto RoomBooking System
http://roombooking.readme.io
187 stars 73 forks source link

FIND_IN_SET error in controllers\Bookings.cfc #57

Closed yiengly closed 8 years ago

yiengly commented 8 years ago

When filtering events list based on a selected location, the following error is thrown:

Error: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]'FIND_IN_SET' is not a recognized built-in function name. Location: Line 57 in controllers\Bookings.cfc Line 52 in controllers\Bookings.cfc

I have tracked it to down to line 394 in function _agendaListWC() in controllers\Bookings.cfc, i.e. this fragment: // Location Filter if(structKeyExists(params, "location") AND len(params.location)){ arrayAppend(wc, "FIND_IN_SET(locationid, '#params.location#')"); }

Was the above meant to be this: // Location Filter if(structKeyExists(params, "location") AND len(params.location)){ arrayAppend(wc, "locationid = '#params.location#'"); }

yiengly commented 8 years ago

Just tested the above change and it is returning the correct events based on the selected locations. The code fragment should be:

// Location Filter if(structKeyExists(params, "location") AND len(params.location)){ arrayAppend(wc, "locationid = '#params.location#'"); }

yiengly commented 8 years ago

Correction. The above solution will only work for single location selection.

neokoenig commented 8 years ago

Sorry, you're hitting problems solely due to using MSSQL which is unsupported: I just can't help you here - I've never used MSSQL nor do I have an installation to test against. You're also making a lot of changes to the codebase where I can't see what you've changed, so you're kinda on your own here. If you're in doubt whether something should work or not, check roombooking.oxalto.co.uk - if the behaviour is correct, then you know it's your own codebase.