Not sure why this hasn't been reported earlier, since it prevents adding or editing limits (happens when adding or editing a limit):

user warning: Column count doesn't match value count at row 1 query: INSERT INTO node_limit VALUES('1', '1', 'Business Listings (one only)', '0') in /home/localie/public_html/local/sites/all/modules/node_limit_dev/node_limit.module on line 521.

You're trying to save 4 values into a db with 5 fields. The type field is either unnecessary now and can be removed or needs to have a value.

Comments

aldenpoetker’s picture

Priority: Normal » Critical

I have loaded the module but am unable to add any node limits. I keep getting the following message:

"user warning: Column count doesn't match value count at row 1 query: INSERT INTO node_limit VALUES('1', '1', 'Limits salon owner to one salon listing per registration', '0') in /home2/visualch/public_html/salonrecruiter/sites/all/modules/node_limit/node_limit.module on line 521."

Were you able to solve this problem? Any help is greatly appreciated as this module would be very helpful to me if it worked!

Alden

mrtoner’s picture

Priority: Critical » Normal

Alden, use the release version, which works fine.

dewolfe001’s picture

I saw this too, but I'm pretty sure I downloaded the release version.
My workaround was:

  db_query("INSERT INTO {node_limit} (lid, `limit`, title, weight, `type`) VALUES ('%d', '%d', '%s', '%d', '%s')", $limit['lid'], $limit['limit'], $limit['title'], $limit['weight'], $limit['element']);
ifoundthetao’s picture

yeah, I independently did the same. This module could be really awesome if it were worked on. I'm working on it now on my own, but that's just to get it working with the Organic Groups node limiting.

there's a bunch of stuff in the dev that's bad news bears, so I don't know if it's worth going through and seeing what they were doing, or starting afresh.

mavimo’s picture

I fix it and some other issue on #668404: Some improvement, code cleaning, and comment. Please test this patch.

arski’s picture

Umm, too bad this module isn't maintained really.. answers like "use the release version" when people are suggesting fixes for the dev version are indeed very helpful :!

mrtoner’s picture

@arksi: Not exactly sure what good that comment was. I was I who suggested both the fix for the dev version and that users continue to use the stable release version. Dev versions are a work in progress and not guaranteed to work as described. If you'd like to step up and maintain this project, feel free to contact the powers-that-be.

duaelfr’s picture

Assigned: Unassigned » duaelfr
Status: Active » Needs review

Fixed the "type" field issue by removing it from the hook_schema (was removed in updates not here)
This has been pushed in the 6.x-1.x branch.

duaelfr’s picture

Status: Needs review » Closed (fixed)

No news, good news.