Hello

When I will click in serwisowo.info/forum when I'm loggoed in there is an error like this:

    Notice: Undefined index: pl w advanced_forum_is_forum_tagged() (linia 317 z serwisowo.info/public_html/sites/all/modules/advanced_forum/includes/style.inc).
    Notice: Undefined variable: reply_link w include() (linia 38 z serwisowo.info/public_html/sites/all/modules/advanced_forum/styles/naked/advanced-forum.naked.comment-wrapper.tpl.php).
    PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pawi_servisovo.drupal_comments' doesn't exist: SELECT f.tid AS tid, COUNT(c.cid) AS count FROM {comments} c INNER JOIN {forum} f ON c.nid = f.nid INNER JOIN {node} n ON f.vid = n.vid LEFT OUTER JOIN {history} h ON c.nid = h.nid AND h.uid = :uid WHERE (c.status = :db_condition_placeholder_0) AND (c.timestamp > :db_condition_placeholder_1) AND( (c.timestamp > :db_condition_placeholder_2) OR (h.timestamp IS NULL ) ) GROUP BY f.tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1291962005 [:db_condition_placeholder_2] => h.timestamp [:uid] => 1 ) w advanced_forum_unread_replies_in_forum() (linia 1328 z serwisowo.info/public_html/sites/all/modules/advanced_forum/advanced_forum.module).

i have no clue what is this :)
please help me

Files: 
CommentFileSizeAuthor
#15 af72_1020190_1.patch3.36 KBtroky

Comments

pawi81’s picture

and also when I will click serwisowo.info/node/1 when i'm logged it there is an error like this:

    Notice: Undefined index: pl w advanced_forum_type_is_in_forum() (linia 1119 z serwisowo.info/public_html/sites/all/modules/advanced_forum/advanced_forum.module).
    Warning: Invalid argument supplied for foreach() w advanced_forum_type_is_in_forum() (linia 1119 z serwisowo.info/public_html/sites/all/modules/advanced_forum/advanced_forum.module).
    Notice: Undefined index: pl w advanced_forum_is_forum_tagged() (linia 317 z serwisowo.info/public_html/sites/all/modules/advanced_forum/includes/style.inc).
NPC’s picture

Subscribing, think this has to do with translations (you have "pl", while I have "ru").

pawi81’s picture

you have same issue, but only with *ru* instead of *pl* ?

NPC’s picture

Yes. I assume your site is in Polish (and mine in Russian).

At least very similar warnings. I've disabled the Advanced Forum for now, and started work on other parts of the website, since this is not too urgent for me at the moment.

pawi81’s picture

now i have error like this (yes, mine is in polish):

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pawi_servisovo.drupal_comments' doesn't exist: SELECT f.tid AS tid, COUNT(c.cid) AS count FROM {comments} c INNER JOIN {forum} f ON c.nid = f.nid INNER JOIN {node} n ON f.vid = n.vid LEFT OUTER JOIN {history} h ON c.nid = h.nid AND h.uid = :uid WHERE (c.status = :db_condition_placeholder_0) AND (c.timestamp > :db_condition_placeholder_1) AND( (c.timestamp > :db_condition_placeholder_2) OR (h.timestamp IS NULL ) ) GROUP BY f.tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1292407071 [:db_condition_placeholder_2] => h.timestamp [:uid] => 1 ) w advanced_forum_unread_replies_in_forum() (linia 1328 z serwisowo.info/public_html/sites/all/modules/advanced_forum/advanced_forum.module).
Michelle’s picture

@pawi81: That is a different issue. Please keep this one on topic.

Michelle

pawi81’s picture

@Michelle sorry.

Michelle’s picture

Title:Notice: Undefined index: pl advanced_forum_is_forum_tagged» Undefined index from passing language into request for node's terms
Assigned:pawi81» Unassigned
Category:support» bug

The line in question is this:

$terms = $node->taxonomy_forums[$node->language];

I did a little searching and it looks like taxonomy got totally changed from the fields API. This line was changed as a result but seems to be choking on the language code. Unfortunately, I haven't been able to find anything that tells how to do this correctly.

Michelle

karlos007’s picture

changing:
includes/style.inc line 317 to: $terms = $node->taxonomy_forums['und'];
and
advanced_forum.module line 1119 to: foreach ($node->taxonomy_forums['und'] as $tforum) {
works for me now. but i think it should be better to give there some IF statement to checking if language is set or is UND

troky’s picture

Fast patch (until I get commit access or something):

Replace includes/style.inc line 317 to:

if (empty($node->language)) {
  $terms = $node->taxonomy_forums['und'];
}
else {
  $terms = $node->taxonomy_forums[$node->language];
}

Replace advanced_forum.module line 1119 to:

if (isset($node->taxonomy_forums)) {
  if (empty($node->language)) {
    $lang = 'und';
  }
  else {
    $lang = $node->language;
  }

  foreach ($node->taxonomy_forums[$lang] as $tforum) {

NPC’s picture

Either I did something wrong, or it doesn't help, as I still get these (now seemingly in the new row numbers):

Notice: Undefined index: ru в функции advanced_forum_is_forum_tagged() (строка 320 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\includes\style.inc).
Notice: Undefined variable: reply_link в функции include() (строка 38 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\styles\naked\advanced-forum.naked.comment-wrapper.tpl.php).
Notice: Undefined index: ru в функции advanced_forum_type_is_in_forum() (строка 1126 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\advanced_forum.module).
Warning: Invalid argument supplied for foreach() в функции advanced_forum_type_is_in_forum() (строка 1126 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\advanced_forum.module).
Notice: Undefined index: ru в функции advanced_forum_is_forum_tagged() (строка 320 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\includes\style.inc).
troky’s picture

Oh, I had bad approach... try this:

Replace includes/style.inc around line 317 and the same line in advanced_forum.module around line 1119 from:

if (empty($node->language)) {

to:

if (!isset($node->taxonomy_forums[$node->language])) {

This issue needs to be redone in few places. Please let me know it works now.

Bubo’s picture

Hi troky,

I'm not sure if this helps, but on my unpatched 2.x-dev (Jan. 15) $node->taxonomy_forums is already "und" where my $node->language is "de" ...

So I get the following error always I'm watching a post:

# Notice: Undefined index: de in advanced_forum_type_is_in_forum() (Zeile 1119 von /srv/www/drupal7/web/sites/labi-forum.de/modules/advanced_forum/advanced_forum.module).
# Warning: Invalid argument supplied for foreach() in advanced_forum_type_is_in_forum() (Zeile 1119 von /srv/www/drupal7/web/sites/labi-forum.de/modules/advanced_forum/advanced_forum.module).

Hope this was senseful...

NPC’s picture

@troky, following your advice in #12, and clearing all caches, I now get these errors:

Notice: Undefined index: ru в функции _advanced_forum_preprocess_node() (строка 47 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\includes\advanced_forum_preprocess_node.inc).
Notice: Trying to get property of non-object в функции _advanced_forum_preprocess_node() (строка 48 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\includes\advanced_forum_preprocess_node.inc).
Notice: Trying to get property of non-object в функции _advanced_forum_preprocess_node() (строка 48 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\advanced_forum\includes\advanced_forum_preprocess_node.inc).

Seems like we're moving, I hope it is in the right direction :)

troky’s picture

Status:Active» Needs review
StatusFileSize
new3.36 KB

Please try attached patch (against current CVS). It includes fix for all $node->taxonomy_forums occurrences.

troky’s picture

Status:Needs review» Fixed

Committed above patch.

NPC’s picture

@troky, thank you very much for working on this. I tried the new dev version (I assume it should include the patch, since you've commited it - the date is the 24th of Jan 2011), and now I get the following warnings and errors on the individual forum page:

Debug:
'Missing handler: node_counter totalcount field'
в функции views_get_handler() (строка 841 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\views\views.module).
Debug:
'Missing handler: node_counter totalcount field'
в функции views_get_handler() (строка 841 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\views\views.module).
Сообщение об ошибке
Notice: Undefined property: stdClass::$unknown в функции views_handler_field->render() (строка 713 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\views\handlers\views_handler_field.inc).
Notice: Undefined property: stdClass::$unknown в функции views_handler_field->render() (строка 713 в файле D:\Projects\tools\xampplite\htdocs\d7\sites\all\modules\views\handlers\views_handler_field.inc).

I am now getting confused as to whether this is the same issue or not, so sorry if this is not the thread to post it in, but I am following up to your recent changes.

troky’s picture

Enable Statistics module.

NPC’s picture

Ah, this is for displaying the number of views of forum topics, sorry for confusion and thanks for the help!

(now I need to find out how I disabled this on an existing D6 site that I'm supporting, to get rid of the dependency on the Statistics module...)

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

juan.bangkok’s picture

Status:Closed (fixed)» Needs work

I migrated from Drupal 6 to 7 and I get the same error:

Notice: Undefined index: und in advanced_forum_is_forum_tagged() (line 346 of /var/www/vhosts/destinotailandia.com/httpdocs/sites/all/modules/advanced_forum/includes/style.inc).

I tried to change the language to my local language in the DB, but It seems that new posts are created as 'und'.

If the code above was already commited (it's from last year) Do you have any idea / comment of what can be happening?

In my case, I'm using 7.x-2.0

troky’s picture

Check #1621218: Facultative forum definition for other types

Install 7.x-2.x-dev and check if problem persists.

troky’s picture

Status:Needs work» Closed (fixed)
dillix’s picture

Status:Closed (fixed)» Needs work

I'm using D7.23 and latest AF 7.x-2.x-dev, and new posts are created as 'und'. I also get this error on main forum page and on topics list page:

Notice: Undefined index: und в функции advanced_forum_is_forum_tagged() (строка 346 в файле /usr/home/test/test.dev/htdocs/sites/all/modules/advanced_forum/includes/style.inc).
Notice: Undefined index: und в функции advanced_forum_is_forum_tagged() (строка 346 в файле /usr/home/test/test.dev/htdocs/sites/all/modules/advanced_forum/includes/style.inc).

I did some research and found why i've got this error. I use this hook to hide statistics link:

function my_custom_entity_view_alter(&$build, $type){
if($type == 'node' && $build['#bundle'] == 'forum' && $build['#view_mode'] == 'full'){
  //Remove views counter
  if(isset($build['links']['statistics'])) unset($build['links']['statistics']);
}

But I don't know why this code interferes with AF and advanced_forum_is_forum_tagged().

mibfire’s picture

same for me too

troky’s picture

Status:Needs work» Postponed (maintainer needs more info)

try to dump $node->taxonomy_forums before line 346 in includes/style.inc

ExTexan’s picture

Ok, maybe this will help. I have two content types used in AF... forum and poll. I added the dump suggested in #26 and then...

1) created a new forum topic
2) created a comment on an existing topic
3) created a new poll topic
4) created a comment on an existing poll topic

1 & 2 worked fine, and 'und' existed in $node->taxonomy_forums.

3 & 4 both got the "Undefined index" error, and I see that the language code is just missing from the taxonomy_forums array. The top-level index of the array is [0].

Also, this might be pertinent... I was also displaying the $form_id from hook_form_alter(). In # 4) above, it showed...

...the taxonomy_forums dump WITHOUT the language code
...then form_id poll_view_voting
...then the taxonomy_forums dump again WITH the language code (and index 0 below that)
...then form_id comment_node_poll_form

Hope this helps.