Closed (fixed)
Project:
Advanced Forum
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2010 at 19:14 UTC
Updated:
18 Oct 2010 at 22:00 UTC
I get the following error after upgrading the module:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/goodserv/public_html/sites/all/modules/advanced_forum/advanced_forum.module on line 1180.
Comments
Comment #1
michelleI looked at the code and, yes, this will happen if you don't have a forum vocabulary or any node types allowed in the forum so it's reasonable to add a sanity check there. But that's got to be some seriously weird configuration to hit that so hardly a critical bug.
Michelle
Comment #2
michelleActually, I looked again and even if you have no node types set to be in the forum you're ok as long as you have a forum vocabulary set. Considering core forum is a requirement, I don't even know how you managed that one. LOL!
Michelle
Comment #3
vip_sa commentedOk thank you! I agree that stating it is critical was a bit over doing it but for someone that don't know what is happening and with an error that you don't understand it seemed critical Should there not be a check that prevents this message from appearing? I created a forum topic node and there were no forum containers or forums when I created it. Not 100% sure what caused it sorry
Comment #4
michelleWell, the only time the core function I'm calling doesn't return an array is when there is no forum vocabulary. Since core forum creates a forum vocabulary when you enable it, the only way this error can occur is if you've screwed up your site. :) I left it as a task because there's no harm in checking that the function returns an array but I don't really consider an error that occurs because your site is broken to be a bug, critical or otherwise. :)
Michelle
Comment #5
vip_sa commentedIt seems that it's not my site I screwed up that it is indeed the module that is not working. I did a clean installation, added no modules except all that is required by advanced forum module and I first created the forums this time but when trying to add a topic to a forum I get the following:
* user warning: Unknown column 'node_comment_statistics.last_updated' in 'field list' query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS nid_1, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format, node.nid AS nid, node.type AS node_type, node.title AS node_title, history_user.timestamp AS history_user_timestamp, node.created AS node_created, node.changed AS node_changed, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, COALESCE(ncs_users.name, node_comment_statistics.last_comment_name) AS node_comment_statistics_last_comment_name, ncs_users.name AS ncs_users_name, node_comment_statistics.last_comment_uid AS node_comment_statistics_last_comment_uid, GREATEST(node.changed, node_comment_statistics.last_comment_timestamp) AS node_comment_statistics_last_updated, term_data.name AS term_data_name, term_data.vid AS term_data_vid, term_data.tid AS term_data_tid, node.sticky AS node_sticky, node.comment AS node_comment, node_comment_statistics.last_updated AS node_comment_statistics_last_updated_1, node.sticky AS topic_is_sticky, forum.tid AS topic_actual_forum FROM node node LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = 3 INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid INNER JOIN users users ON node.uid = users.uid LEFT JOIN users ncs_users ON node_comment_statistics.last_comment_uid = ncs_users.uid AND ncs_users.uid != '0' LEFT JOIN forum forum ON node.vid = forum.vid WHERE (node.status <> 0) AND ((history_user.timestamp IS NULL AND (node.changed > (1284471849 - 2592000) OR node_comment_statistics.last_comment_timestamp > (1284471849 - 2592000))) OR history_user.timestamp < node.changed OR history_user.timestamp < node_comment_statistics.last_comment_timestamp) AND (term_data.vid in ('1')) GROUP BY nid_1 ORDER BY node_sticky DESC, node_comment_statistics_last_updated_1 DESC ) count_alias in /home/goodserv/public_html/sites/all/modules/views/plugins/views_plugin_pager.inc on line 141.
* user warning: Unknown column 'node_comment_statistics.last_updated' in 'field list' query: SELECT DISTINCT(node.nid) AS nid_1, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format, node.nid AS nid, node.type AS node_type, node.title AS node_title, history_user.timestamp AS history_user_timestamp, node.created AS node_created, node.changed AS node_changed, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, COALESCE(ncs_users.name, node_comment_statistics.last_comment_name) AS node_comment_statistics_last_comment_name, ncs_users.name AS ncs_users_name, node_comment_statistics.last_comment_uid AS node_comment_statistics_last_comment_uid, GREATEST(node.changed, node_comment_statistics.last_comment_timestamp) AS node_comment_statistics_last_updated, term_data.name AS term_data_name, term_data.vid AS term_data_vid, term_data.tid AS term_data_tid, node.sticky AS node_sticky, node.comment AS node_comment, node_comment_statistics.last_updated AS node_comment_statistics_last_updated_1, node.sticky AS topic_is_sticky, forum.tid AS topic_actual_forum FROM node node LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = 3 INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid INNER JOIN users users ON node.uid = users.uid LEFT JOIN users ncs_users ON node_comment_statistics.last_comment_uid = ncs_users.uid AND ncs_users.uid != '0' LEFT JOIN forum forum ON node.vid = forum.vid WHERE (node.status <> 0) AND ((history_user.timestamp IS NULL AND (node.changed > (1284471849 - 2592000) OR node_comment_statistics.last_comment_timestamp > (1284471849 - 2592000))) OR history_user.timestamp < node.changed OR history_user.timestamp < node_comment_statistics.last_comment_timestamp) AND (term_data.vid in ('1')) GROUP BY nid_1 ORDER BY node_sticky DESC, node_comment_statistics_last_updated_1 DESC LIMIT 0, 20 in /home/goodserv/public_html/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1119.
I disabled the module and everything is working fine. The normal forum works perfectly.
Comment #6
michelleThat's a completely unrelated Views 3 bug. #833790: Click sorting causes malformed query with Node: Updated/commented date
Please stick to one issue per issue.
Michelle
Comment #7
michelleCommitted.
Michelle