I have just created a Drupal 6 site with the Deco template and I get the following error when reading a forum messages. It does not happen on nay other pages. Any ideas?

warning: include_once(themes/deco/forum-topic-navigation) [function.include-once]: failed to open stream: No such file or directory in U:\xampp\htdocs\includes\theme.inc on line 587.
warning: include_once() [function.include]: Failed opening 'themes/deco/forum-topic-navigation' for inclusion (include_path='.;\xampp\php\pear\') in U:\xampp\htdocs\includes\theme.inc on line 587.
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'deco_forum_topic_navigation' was given in U:\xampp\htdocs\includes\theme.inc on line 591.

CommentFileSizeAuthor
#12 deco-tpl-error_261884-12.patch594 bytesadd1sun

Comments

bertusvdalen’s picture

The same thing for me. The problem would be solved with the dev version but this seems not be the case.

johnmullin2003’s picture

Priority: Normal » Critical

please if anyone who solved this issue, post here the bug fix.

many thanks.

it is critical.

greetings

johnmullin2003’s picture

all problems solved. open the deco/template.php and edit the lines in this way:

/**
 * Implementation of hook_theme()
 */
function deco_theme() {
  return array(
    'deco_forum_topic_navigation' => array(
      'file' => 'forum-topic-navigation.tpl.php',
      'arguments' => array('node' => NULL),
    )
  );
}

.

then save, replace, disable theme and then re-enable theme to fix all.

edit: this way gives me problem because the urls are changed in "node?destination=" that is a common issue in forum... i wait for a next fix :-(

Red Sam Flint’s picture

thanks. that seems to have solved the error message. but did it solve the problem? what is the problem?

JStarcher’s picture

eh wouldn't it be more like this:

/**
 * Implementation of hook_theme()
 */
function deco_theme() {
  return array(
    'forum_topic_navigation' => array(
      'file' => 'forum-topic-navigation.tpl.php',
      'arguments' => array('node' => NULL),
    )
  );
}

That fixes it for me.

wdmartin’s picture

If you look at the documentation for hook_theme(), you'll find that the "file" key is supposed to define "The file the implementation resides in. This file will be included prior to the theme being rendered, to make sure that the function or preprocess function (as needed) is actually loaded; this makes it possible to split theme functions out into separate files quite easily."

So the "file" part is supposed to specify a file containing PHP functions. The forum-topic-navigation.tpl.php file does NOT contain PHP theme functions; it contains templating data. I'm not sure what effect you'll get from trying to treat a template file as a theme functions file, but I guarantee it's not going to yield the designer's intended code.

The correct fix is to change the key from "file" to "template", thus:

function deco_theme() {
  return array(
    'forum_topic_navigation' => array(
      'template' => 'forum-topic-navigation',
      'arguments' => array('node' => NULL),
    )
  );
}

Note that when specifying a template file's name, you don't add the .tpl.php extension; that's supplied automatically.

ronniead’s picture

Hi,

I am still getting this error when I go to the themes page. (administer->themes).

# warning: include_once(sites/all/themes/deco/forum-topic-navigation) [function.include-once]: failed to open stream: No such file or directory in /home/blackbox/public_html/drupal/includes/theme.inc on line 283.

# warning: include_once() [function.include]: Failed opening 'sites/all/themes/deco/forum-topic-navigation' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackbox/public_html/drupal/includes/theme.inc on line 283.
rootwork’s picture

Status: Active » Needs review

You probably need to flush the cache. Disable the theme (switch to some other theme, and uncheck "enabled") then re-enable it. You can also flush the cache manually at /admin/settings/performance

greg.harvey’s picture

Status: Needs review » Reviewed & tested by the community

wdmartin's patch works for me. Any objections to "reviewed and tested" status?

nut’s picture

Worked, thank.

darumaki’s picture

delete
never mind, it was something else that was causing blank page, all is fine :)

add1sun’s picture

StatusFileSize
new594 bytes

Here is an actual patch.

add1sun’s picture

Status: Reviewed & tested by the community » Fixed

Oh, heh, OK. So this whole function isn't needed at all. That tpl is a core template file and is already registered. This was fixed in HEAD but not the D6 branch. I've now synced 6 and HEAD so this is fixed in dev. A new release will be forthcoming soon.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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