I just upgraded from MySite 5.x-2.14 to 5.x-2.15 on Drupal 5.5 with MySQL 5.0.45, PHP 5.2.5, and an Apache/2 webserver. When I did so, I suddenly could not post forum topics in their Forums anymore. Instead, I got this error on clicking the Submit button: "Could not find forum title" (everything works fine except the post doesn't get placed in the proper forum; the post shows up with the error above it).

I know this is a MySite error because I googled the error and it shows up in MySite's API. I then disabled MySite and tried submitting a forum topic, and this time it worked.

I have zero ideas about what could have caused the error other than it must have been something changed between 2.14 and 2.15. I want to launch my site by Monday though, so expediency in answering this issue would be greatly appreciated. I'm going to try using a newer version of MySite to see if the error was fixed, but I somehow doubt it.

Thanks.

Comments

icecreamyou’s picture

I upgraded to 5.x-3.0beta2. When I tried to submit a forum topic, I got this error, which includes "could not find forum title":

    * user warning: Duplicate entry '0-1' for key 1 query: INSERT INTO mysite_page (page, uid, created, updated, status, title, layout, style, format, theme) VALUES (0, 1, 1194322687, 1199468873, 1, 'IceCreamYou\'s BabelUp', 'stacks', 'midnight', 'teasers', 'bluemarine') in [full path removed]/public_html/includes/database.mysql.inc on line 172.
    * Could not find forum title
    * user warning: Duplicate entry '0-1' for key 1 query: INSERT INTO mysite_page (page, uid, created, updated, status, title, layout, style, format, theme) VALUES (0, 1, 1194322687, 1199468873, 1, 'IceCreamYou\'s BabelUp', 'stacks', 'midnight', 'teasers', 'bluemarine') in [full path removed]/public_html/includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry '0-1' for key 1 query: INSERT INTO mysite_page (page, uid, created, updated, status, title, layout, style, format, theme) VALUES (0, 1, 1194322687, 1199468873, 1, 'IceCreamYou\'s BabelUp', 'stacks', 'midnight', 'teasers', 'bluemarine') in [full path removed]/public_html/includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry '0-1' for key 1 query: INSERT INTO mysite_page (page, uid, created, updated, status, title, layout, style, format, theme) VALUES (0, 1, 1194322687, 1199468873, 1, 'IceCreamYou\'s BabelUp', 'stacks', 'midnight', 'teasers', 'bluemarine') in [full path removed]/public_html/includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry '0-1' for key 1 query: INSERT INTO mysite_page (page, uid, created, updated, status, title, layout, style, format, theme) VALUES (0, 1, 1194322687, 1199468873, 1, 'IceCreamYou\'s BabelUp', 'stacks', 'midnight', 'teasers', 'bluemarine') in [full path removed]/public_html/includes/database.mysql.inc on line 172.

"IceCreamYou" is user 1 and the name of users' MySites is "My BabelUp." The theme is BlueMarine. I've removed the full path of database.mysql.inc.

agentrickard’s picture

Assigned: Unassigned » agentrickard

You get this error when trying to create a forum topic? Or when trying to add a forum topic to a MySite collection?

agentrickard’s picture

Status: Postponed (maintainer needs more info) » Active

OK. Let's deal only with 5.x.2.15, which is the currently supported release.

I cannot reproduce this error without forcing MySite to return an empty forum node id. Looking at the CHANGELOG, there are no modifications to forum handling between 5.x.14 and 5.x.15.

This error appears when MySite cannot find a forum that has been requested. It is only really used for debugging, because this error should never appear to a site visitor.

Have you made any other changes to your site? Installed any other new modules? Enabled any access controls (like OG, or Taxonomy Access)? MySite should not interfere in how forums get posted in any way.

I suspect that some other module is causing the problem with the posting, and then MySite cannot find the forum correctly.

To debug this, it would be good to replace the following code into the forum.inc file.


/**
 * Implements mysite_type_hook_title(). 
 */
function mysite_type_forum_title($type_id = NULL, $title = NULL) {
  print "debug: $type_id : $title";
  if (!empty($type_id)) {
    print " not empty";
    if (is_null($title)) {
      print " no title";
      $forum = taxonomy_get_term($type_id);
      $title = $forum->name;
    }
    $type = mysite_type_forum(FALSE);
    $title = $type['prefix'] .' '. $title .' '. $type['suffix'];
    $title = trim(rtrim($title));
    print " $title <br />";
    return $title;
  }
  drupal_set_message(t('Could not find forum title'), 'error');
  return;
}
agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

You might also try replacing this function, which should eliminate the error report, but I don't think it will fix your issue with forum posts in the wrong place.

/**
 * Implements mysite_type_hook_block_node(). 
 */
function mysite_type_forum_block_node($nid, $type) {
  if ($type == 'forum') {
    global $user;
    $sql = db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t INNER JOIN {forum} f ON f.tid = t.tid WHERE f.nid = %d", 't', 'tid');
    $forum = db_fetch_object(db_query($sql, $nid));
    if (isset($forum->tid)) {
      $data = array();
      $data['uid'] = $user->uid;
      $data['type'] = $type;
      $data['type_id'] = $forum->tid;
      $data['title'] = mysite_type_forum_title($forum->tid, $forum->name);
      $content = mysite_block_handler($data);
      return $content;
    }  
  }
}

This would work in cases where you have some sort of access restriction on forum content.

icecreamyou’s picture

Status: Active » Postponed (maintainer needs more info)

I get the errors when trying to add a forum topic.

I just did more testing and as it turns out, MySite is not actually causing this issue--it's just reporting it. I wouldn't have had any idea about this problem otherwise until the site launched, so I guess a thanks is in order.

I'm completely stumped about what could be causing the problem though. I've tried disabling practically every module that could possibly have anything to do with this, and nothing's fixed it. :(

Thanks anyway. :-/

agentrickard’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Active

You might search your contributed module code for implementations of hook_form_alter(). That is a likely culprit.

If you want to post a module list, I can see if there are any likely candidates.

I did find, however, that there are legitimate cases where MySite can throw this error when it should not, so there was a bugfix here.

icecreamyou’s picture

Actually, I disabled every module that forum.module doesn't directly depend on, and it still didn't work. I'm convinced it's an installation problem, so I wiped everything (after backing it all up!) and am in the process of restoring it. I have a feeling that when I upgraded from Drupal 5.2 to 5.5, my FTP program corrupted or didn't transfer some crucial files.

If that doesn't work, I plan to restore a backup from January 1 on Drupal 5.2 which I'm pretty sure works and go from there.

agentrickard’s picture

Status: Active » Closed (fixed)

Good luck.

icecreamyou’s picture

In case anyone else has this same problem: the issue wasn't MySite or my installation files; it was unsynced databases. See http://drupal.org/node/172628#comment-268264