I think there is a bug in the latest version as I get this error when I update my database script
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0)' at line 1 query: INSERT INTO advforum_last_post (tid, nid, cid) VALUES(1, , 0) in xxxxxxxxxxx/sites/all/modules/advanced_forum/advanced_forum.install on line 97.
The following queries were executed
advanced_forum module
Update #5002
* DELETE FROM {advforum_last_post} WHERE tid = 2
* INSERT INTO {advforum_last_post} (tid, nid, cid) VALUES(2, 122, 0)
* DELETE FROM {advforum_last_post} WHERE tid = 1
* Failed: INSERT INTO {advforum_last_post} (tid, nid, cid) VALUES(1, , 0)
So I went back to your previous version for the time.
Comments
Comment #1
sgdev commentedI'm having the same issue in 5.x-1.0-alpha9. This is an issue with the install script.
In the CREATE TABLE for Update #5001, nid is set as
nid int unsigned NOT NULL default '0'. However in the INSERT statements in Update #5002, many of the nids are set as blank / null. Do you need the nids to be blank / null or zero?Update -- Just did a quick check by setting nid equal to "0" and manually re-inserting the failed rows into the
advforum_last_posttable. This doesn't seem to be the right answer since I got a user warning error message for every row. :)Comment #2
michelleSorry, folks, it looks like somehow between testing this and committing this I lost some of my changes. No clue whatsoever how I managed to do that but the code both in cvs and on my dev site is an earlier version. Very bizarre. I can remember making the changes and testing them out and seeing that they worked and now they're not there. Anyway, I'll get this fixed up sometime today.
Michelle
Comment #3
michelleOk, I was wrong. Dealing with this first thing on waking up and getting myself confused. There is code that vanished, but that's on the .module side of things and not in the .instal. No, the .install should never be inserting blank nids. That's actually the problem... I never tested this on a site that has empty forums. Thanks for the clue, I'll get this fixed ASAP.
Michelle
Comment #4
michelleOk, I just ripped out everything I spent the last week working on and am trying again with using queries instead of a table. It fixes the problem but the question is how it will perform on large forums. I'll do some more testing with a larger set of generated data and see how it goes.
Committed to 5.x. Will port to 6.x if it looks like it will work.
Michelle
Comment #5
weimeng commentedAlso affected by this issue, subscribing.
Comment #6
droshani commentedJust keep to the version from May 29th you will be fine, till an stable version become available.
Comment #7
michelleThe new alphas are perfectly usable. They just don't fill in the initial values for the last topic so they will read "n/a" until something new is posted in that forum. If you know your way around a database, just make one record for each forum tid and leave the nid/cid 0 and it should pick up on them being wrong and correct them automatically.
I don't know when there will be a new release. Still trying to work out what to do about this last topic fiasco.
Michelle
Comment #8
jannalexx commentedsame issue here 5.x-1.0-alpha9 Upgrade
advforum_last_post table error upgrading from alpha8 to alpha9
uninstalling and installing new alpha9 stops with error:
Fatal error: Call to undefined function update_sql() in ...\modules\advanced_forum\advanced_forum.install on line 106
Comment #9
michelleMaking title more accurate and fixing the version.
Michelle
Comment #10
Fayna commentedSubscribing. Works fine besides the error on installation.
Comment #11
michelleCommitted to 6.x as well now.
Michelle
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
kirikintha commentedHey guys, I changed the for each to this and the error goes away, and I cannot see any problems with the module, so maybe it works? on Line 106 or there abouts,
Let me know if this is useless or not.