I am using the bookreview module and it all works now brilliantly except for the teasers. There are none. In fact, in my database the node_revisions table is virtually empty for bookreview nids (okay, all fields are completed except body, teaser and log). I think this is fine as content is all stored in the bookreview tables.

Where though, do the teasers come from, or should they be coming from? There is no qb_query to insert into node_revision/table that I can see, nor any db_query relating to the teasers.

They must, then be constructed some other way then, right? But why aren't they working for me? Other people don't seem to be having a problem, so I'm really quite confused.

I have made some other slight amneds to the code, but, using a programme to examine the differences, there are none for the code that I think effects the teaser. I've included this here - maybe I'm missing something?

Any help is very very very much appreciated.

thanks

function bookreview_validate(&$node) {
  if (variable_get('teaser_length', 600)) {
    if ($node->synopsis) {
      $node->teaser = check_markup(node_teaser($node->synopsis), $node->format);
    }
    else {
      $node->teaser = check_markup(node_teaser($node->review), $node->format);
    }
  }
  else {
    // teasers are disabled, display whole book review
    $node->teaser = check_markup($node->body, $node->format);
  }

  if (isset($node->review)) {
    $word_count = count(explode(' ', $node->review));
    if ($word_count < variable_get('minimum_bookreview_size', 0)) {
      form_set_error('review', t('The body of your book review is too short. You are required to enter at least %minimum_word_count words, but you\'ve only entered %word_count.', array('%minimum_word_count' => variable_get('minimum_bookreview_size', 0), '%word_count' => $word_count)));
    }
    else if (!$node->review) {
      form_set_error('review', theme('error', t('You are required to enter text for your book review.')));
    }
  }
}

and then

function bookreview_view(&$node, $teaser = FALSE, $page = FALSE) {
  global $theme;

  if ($page) {
    // Allows themes to override how the review should look like,
    // but we cannot depend on the theme() functions, since we
    // need to pass the node by reference!
    $themefunction = "{$theme}_bookreview_content";
    if (!function_exists($themefunction)) {
      $themefunction = 'theme_bookreview_content';
    }
    $node = node_prepare($node, $teaser);
    $themefunction($node, $main, $page);
  }
}

Comments

SparkyUK’s picture

yeah! Jeremey fixed this here! Many many thanks!