#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Posts
    4
    Rep Power
    0

    Method not found error


    Cant work out why I am getting this error
    The method getLatestThreads was not found in component forum.cfc.
    Calling it from rss.cfm
    <cfset data = application.forum.getLatestThreads(forumid=url.forumid)>

    <cffunction name="getLatestThreads" access="public" returnType="query" output="false"
    hint="Retrieve the last 20 posts to any threads in forums in this forum.">
    <cfargument name="forumid" type="uuid" required="true">
    <cfset var qLatestThreads = "">

    <cfquery name="qLatestThreads" datasource="#variables.dsn#">
    <cfif variables.dbtype is "oracle">
    select * from (
    </cfif>
    select
    <cfif not listFindNoCase("mysql,oracle",variables.dbtype)>
    top 20
    </cfif>
    #variables.tableprefix#messages.title, #variables.tableprefix#threads.name as thread,
    #variables.tableprefix#messages.posted, #variables.tableprefix#users.username,
    #variables.tableprefix#messages.threadidfk as threadid,
    #variables.tableprefix#messages.body,
    #variables.tableprefix#threads.forumidfk,
    #variables.tableprefix#forums.conferenceidfk
    from #variables.tableprefix#messages, #variables.tableprefix#threads, #variables.tableprefix#users, #variables.tableprefix#forums
    where #variables.tableprefix#messages.threadidfk = #variables.tableprefix#threads.id
    and #variables.tableprefix#messages.useridfk = #variables.tableprefix#users.id
    and #variables.tableprefix#threads.forumidfk = <cfqueryparam value="#arguments.forumid#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
    and #variables.tableprefix#forums.conferenceidfk = #variables.tableprefix#conferences.id
    order by #variables.tableprefix#messages.posted desc
    <cfif variables.dbtype is "mysql">
    limit 20
    <cfelseif variables.dbtype is "oracle">
    ) where rownum <= 20
    </cfif>
    </cfquery>

    <cfreturn qLatestThreads>
    </cffunction>
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    If you cfdump the application.forum CFC, I assume you will not see the method. If the CFC is created at app startup and cached in the application scope, you'd need to refresh the app or restart CF for any changes to be picked up.

IMN logo majestic logo threadwatch logo seochat tools logo