Closed (fixed)
Project:
Inf08
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
27 Apr 2009 at 09:44 UTC
Updated:
12 May 2009 at 16:20 UTC
Jump to comment: Most recent file
warning: Invalid argument supplied for foreach() in template.php on line 143.
I do not get the warning when i switch to any other themes on my drupal 6.10 installation.
Interestingly, the warning is only displayed on pages that display a view. Using Views 6.x.2.3.
Any help is appreciated. This seems to be a really good theme.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | comment_display.jpg | 105.54 KB | ookello |
| #5 | template.php_.tar_.gz | 3.25 KB | kong |
| #2 | output_message.tar_.gz | 297.89 KB | ookello |
Comments
Comment #1
kong commentedThis is interesting. I'd like to have more info on what's going on in that page. Could you add this line to the
template.phpfile:in the line just right after
function phptemplate_preprocess_node(&$vars) {(~line 96) and open the page which has the problem.You can copy the output message into file and attach it here. Thanks :)
Comment #2
ookello commentedOne one of the pages that display a view and that warning, I got a php memory limit error after tryig to display the output message.
Although, I did copy the output message from a page displaying a different view. On this page the invalid argument warning is for line 144 in template.php. The text is attached.
The page is not a direct page to a view, rather I embedded a view into the page using the below code.
Comment #3
ookello commentedI guess the line # changed after i edited the template.php for posting messages.
The warning was again generated for the same function:
// put all comment related links into a separate variable
foreach ($vars['node']->links as $key => $value) {
Wish i could help you debug this but i'm not really a programmer. Nevertheless, I will still keep fighting this.Thanks again.
Comment #4
kong commentedAttached is the modified
template.php.Please backup the original file and use this file to see if it fix the problem.
If everything's OK then I'll apply the changes to the theme package.
Comment #5
kong commentedWhoops, forgot to attach the file...
Comment #6
ookello commentedThat fixed it. No more warnings.
Thanks much. :)
Comment #7
kong commentedComment #8
ookello commentedI guess that did introduce a minor bug in the comment display. For unauthenticated users the comment display below the title does not show up correctly. It displays correctly for authenticated user.
I have attached a screenshot. Left window is for the authenticated user, and right unauthenticated.
Here is the html for authenticated user:
for unauthenticated user:
Not sure if i should open up a new issue for this?
Comment #9
kong commentedAh... that's the same issue as #442694: login to post comment displays as html, which I already fixed in CVS.
You may want to download the 6.x-1.x-dev package OR you can modify
template.phpby copy & paste the code in green background on this page :)