forum-topic-navigation error

MaxCross - May 23, 2008 - 10:29
Project:Deco
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

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.

#1

bertusvdalen - May 23, 2008 - 11:31

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

#2

johnmullin2003 - June 27, 2008 - 11:25
Priority:normal» critical

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

many thanks.

it is critical.

greetings

#3

johnmullin2003 - June 27, 2008 - 23:26

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 :-(

#4

Red Sam Flint - June 30, 2008 - 21:06

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

#5

JStarcher - July 4, 2008 - 17:36

eh wouldn't it be more like this:

<?php
/**
* 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.

#6

wdmartin - July 9, 2008 - 16:22

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:

<?php
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.

#7

ronniead - July 17, 2008 - 13:37

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.

#8

rootwork - July 30, 2008 - 05:20
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

#9

greg.harvey - July 30, 2008 - 13:53
Status:needs review» reviewed & tested by the community

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

#10

nut - August 4, 2008 - 04:27

Worked, thank.

#11

darumaki - August 5, 2008 - 22:22

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

#12

add1sun - August 6, 2008 - 17:20

Here is an actual patch.

AttachmentSize
deco-tpl-error_261884-12.patch 594 bytes

#13

add1sun - August 7, 2008 - 17:11
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.

#14

Anonymous (not verified) - August 21, 2008 - 17:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.