Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:38:37+00:00 2026-06-09T08:38:37+00:00

Ok, so this is really confusing me now, because I had this working a

  • 0

Ok, so this is really confusing me now, because I had this working a while back and something has changed which has caused my calculated properties to not work.

I have a “page” controller that does a findAll() on the “link” model. This works great, except for when I try to include a calculated property (which used to work).

page.cfc (controller)

<cfset linkListHottest = model("link").findAll(

            select="

                links.linkID,
                linkTitle,
                linkPoints,
                linkAuthority,
                linkCreated,
<!--- Here I specifiy the 'property' names from the model --->
                linkUpVoteCount,
                linkDownVoteCount,
                linkCommentCount,

                users.userID,
                userName,

                categories.categoryID,
                categoryTitle,
                categoryToken",

            include="user,category", 
            order="linkPoints DESC",
            handle="linkListHottestPaging",

            page=params.page,
            perPage=5

        ) />

link.cfc (model)

<cffunction name="init">

        <cfset table("links") />

<!--- These three lines aren't populating my queries on the link model --->
        <cfset property(name="linkUpVoteCount", sql="(SELECT COUNT(*) FROM votes WHERE votes.linkID = links.linkID AND voteType = 1)") />
        <cfset property(name="linkDownVoteCount", sql="(SELECT COUNT(*) FROM votes WHERE votes.linkID = links.linkID AND voteType = 0)") />
        <cfset property(name="linkCommentCount", sql="(SELECT COUNT(*) FROM comments WHERE comments.linkID = links.linkID AND commentRemoved = 0)") />

        <cfset belongsTo(name="user", modelName="user", joinType="outer", foreignKey="userID") />
        <cfset belongsTo(name="category", modelName="category", joinType="outer", foreignKey="categoryID") />

        <cfset hasMany(name="vote", modelName="vote", joinType="outer", foreignKey="linkID") />
        <cfset hasMany(name="comment", modelName="comment", joinType="outer", foreignKey="linkID") />   

        <cfset validatesPresenceOf(property='linkTitle') />
        <cfset validatesPresenceOf(property='linkURL') />
        <cfset validate(property='linkURL', method='isValidURL') />
        <cfset validate(property='linkURL', method="validateUniqueUrl", when="onCreate") />

    </cffunction>

home.cfm (view)

#linkListHottest.linkUpVoteCount#

I get the following error:

Unknown column ‘linkUpVoteCount’ in ‘field list’

Ok, I thought, let’s remove the column names from the SELECT in the findAll() and see if that solves it. Nope:

column [LINKUPVOTECOUNT] not found in query, columns are
[linkID,linkTitle,linkPoints,linkAuthority,linkCreated,userID,userName,categoryID,categoryTitle,categoryToken]

So it seems like a catch 22 situation. It’s almost as if my “link” model is ignoring the properties set there entirely.

I would appreciate any feedback on where I’m going wrong (I’m sure it’s me!).

Many thanks,
Michael.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:38:39+00:00Added an answer on June 9, 2026 at 8:38 am

    Sounds like this is a bug with Wheels. I suggest filing an issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning MVC3 now and this is really confusing me. I have a
Edit: The bug which prompted this question has now been fixed . In the
This is really confusing me. I will show my code so far. I am
This is really confusing me as I'm not doing anything with Strings. This is
This is probably very simple but it's really confusing me. When I implement the
I need to ask something that really confusing regarding joins What I think and
This is a really confusing error, as it crops up in some of the
I have a class which looks something like this: class MyClass { public: //
This really seems like a bug to me, but perhaps some databinding gurus can
This really shouldn't be hard, I just can't figure out how to do it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.