Skip to main content
July 3, 2010
Question

Validation error for tag cfloop

  • July 3, 2010
  • 2 replies
  • 8299 views

Hi All,

Complete newbie to CF here.  I've inherited (or bought) an online business which has its site written in CF.  I haven't done this sort of stuff before but do work SQL for a living and object oriented stuff plus have done a bit of html and php so CF isn't mind blowing to me (in its simple form).

I've downloaded my site on to my computer to run a local copy that I can hack to pieces if needs be.  For some reason, I have a few problems with the site running locally.  The first error I'm getting is a Attribute validation error for tag cfloop.

Basically, index.cfm has this bit of code in it:

<cfinvoke component="#datasets#" method="storedProcedure" returnvariable="getFeaturedWineries_qry">
    <cfinvokeargument name="storedProcedure" value="usp_GetFeaturedWineries">
</cfinvoke>

Ok, easy enough.  Anyway, there's a call down the page to:

<cfinclude template = "#REQUEST.CFMPath#includes/displayFeaturedWineries.cfm">

Within displayFeaturedWineries.cfm is the code that calls the stored proc invoked above:

<cfloop query="getFeaturedWineries_qry" startrow="1" endrow="2">

Bam, that's where the error occurs.  "The value of the attribute query, which is currently getFeaturedWineries_qry, is invalid.

What???  The stored proc exists and it only returns two records (which begs me to wonder why you would have startrow and endrow but anyway, it doesn't work with or without it).

The other interesting thing is that this works on production, NO PROBLEM!!!  WTF?  How can it work on production but not locally.

The only thing I'm starting to think is:

a)  I've missed a setting somewhere in CF or

b)  I'm running Apache as compared to IIS or

c)  I'm running SQL 2008 and CF 9 which will no doubt be different to the production host server.

Should B or C be causing THAT type of problem??

Thanks,

Matt

    This topic has been closed for replies.

    2 replies

    July 5, 2010

    Just when I think it's fixed....it's not.

    It now works fine in CF 8 on the index page only.  Still getting the error on all others pages......any suggestions?

    Inspiring
    July 3, 2010

    Here are some thing to try.

    1. You can use the CFDUMP tag to output the values of variables to assist you in troubleshooting.  If you use CFDUMP output the value of getFeaturedWineries_qry on the line before the CFLOOP do the contents appear as expected?

    2. Does a CFDUMP of #REQUEST.CFMPath#includes/displayFeaturedWineries.cfm point to a file that exists on your system?

    3. Same for #datasets#.

    4. In regards to Apache vs. IIS, could there be an issue with a path or other value being case sensitive in Apache?

    5. In regards to SQL Server does a SQL profile/trace actually show any queries/stored procedures being executed?

    It might be helpful to have more of your code to look at as well as more details about how your enviroment is setup.

    CFDUMP tag documentation

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ef7.html

    July 4, 2010

    The cfdump shows me exactly what I thought, its looking for the stored proc usp_Featured Wineries.  After looking through more pages on the site, almost all pages have some kind of validation error for tag cloop around stored procs, BUT, not all.  The user that logs into the database is a dbo so I can't see what the problem is there.

    I installed IIS7 and got that working fine, so its not an Apache / IIS thing either.  I might try and trace the database server to see if there's a problem there, but I'm guessing its a setting problems either on the Database itself or ColdFusion.  None of it makes any sense otherwise (why would it run some procs and not others???).

    Any other thoughts?

    Inspiring
    July 4, 2010

    It is would be easier to advise you if you would post additional source code and error messages, if any, you receive.