where 0 = 0 looks like its obsolete in that query, in other words it
shouldn't be needed if you have no if statements there. As you said it
works on ColdFusion 10, what would happen if you removed the 0 = 0 or
replaced it with 1 = 1?

Other than that I really can't see any other issue with it.

When you say is ignored, are you saying records are returning or no records
are being returned? You also don't indicate whether you have an error, so
we can assume that what is calling this is working to some degree with
records in the grid?

Also there is a huge push to remove any UI tags from Application code, it
might pay to think about moving away from the likes of the current CF UI
stuff.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+:  http://plus.google.com/113032480415921517411



On Wed, Jul 23, 2014 at 3:08 AM, Stephen Hait <stephenh...@gmail.com> wrote:

>
> We have a CF app that uses a CF_GRID with some filters to allow limiting
> the data retrieved. After moving the app from a host running CF10 to
> another host running CF11, the filters stopped working even though the
> other grid functions did not - grid still display data correctly and
> clicking column headers correctly sorts the grid.
>
> This is the contents of the cfgrid tag:
>
> <cfgrid
> format="html"
> name="pilotGrid"
>  pagesize="10"
> autowidth="yes"
> selectmode="row"
>  appendKey="yes"
> href="index.cfm?fuseaction=dsp_adm-pilot-detail"
> hrefKey="userid"
>
>  
> bind="cfc:pilot_search.getPilots({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},
> '#attributes.pil_email#', '#attributes.pil_lname#',
> '#attributes.pil_n_number#')">
>
> The bind parameter specifies a function, getPilots, in pilot_search.cfc. It
> passes 3 attributes/parameters to the function which are the contents of
> the 3 text filters - pil_email, pil_lname, pil_n_number. The function
> contains a query to retrieve the requested data including WHERE clauses
> based on the filter text entered.
>
> This is the content of the function and query contained in
> pilot_search.cfc:
>
> <cffunction name="getPilots" access="remote" returntype="struct">
>  <cfargument name="page" required="true" />
> <cfargument name="pageSize" required="true" />
>  <cfargument name="gridsortcolumn" required="true" />
> <cfargument name="gridsortdirection" required="true" />
>  <cfargument name="pil_email" type="string" required="no" default="" />
> <cfargument name="pil_lname" type="string" required="no" default="" />
>  <cfargument name="pil_n_number" type="string" required="no" default="" />
>  <cfif arguments.gridsortcolumn eq "">
> <cfset arguments.gridsortcolumn = "pil_email" />
>  <cfset arguments.gridsortdirection = "asc" />
> </cfif>
>
> <cfquery name="pilots" datasource="hope">
>  select userid, pil_n_number, pil_email, pil_lname, pil_fname,
> pil_password, last_login
> from pilots
>  where 0=0
> and pil_email like <cfqueryparam cfsqltype="cf_sql_varchar"
> value="%#arguments.pil_email#%">
>  and pil_lname like <cfqueryparam cfsqltype="cf_sql_varchar"
> value="%#arguments.pil_lname#%">
> and pil_n_number like <cfqueryparam cfsqltype="cf_sql_varchar"
> value="%#arguments.pil_n_number#%">
>
> order by #arguments.gridsortcolumn# #arguments.gridsortdirection#
> </cfquery>
>
> <cfreturn queryconvertforgrid(pilots, page, pagesize) />
> </cffunction>
>
> Does anyone know why the WHERE clauses in the query appear to be ignored
> when running the app with CF11 but work correctly with CF10?
>
> Or does anyone have a suggestion of how to best debug this? I can't seem to
> figure out how to view the contents of the 3 arguments used in the WHERE
> clauses to see why they might be being ignored or why the result set is not
> limited by the filters on CF11.
>
> Any insight or suggestions appreciated.
>
> Regards,
> Stephen
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358961
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to