Preprocess functions cause white screen
Greetings,

When I add the preprocess function to my theme, I end up a white screen.

I did not change the view or file names.

I have removed <?php from the beginning of the code and correctly changed [THEME_NAME] on both functions.

Everything else appears to be working, as without the preprocess functions, the block displays the same preview I see when editing the news_items View.

Comments

ppblaauw’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc6
Assigned: mrnes » Unassigned
Category: bug » support

The blogbuzz theme you use comes already with preprocess functions for the ddblock module. You can not have a preprocess function with the same name twice in the template.php file.

You need to remove these preprocess functions

or

when you also use the view: "showcase_with_image" in these preprocess function you need to move the if statement for this view in these preprocess function to the newly added preprocess functions and remove the old preprocess functions.

Hope this helps you further, please let me know.

PS. Tip:

Leave assigned to unassigned, when you assign an issue to yourself it means: I will solve the issue, nobody else has to do something.

I put version to RC6, because I see you use the preprocess function for ddblock RC6 and I make the issue a support request.

greenavus’s picture

I am using the Drigg theme on my site and when i get to the preprocess function , It shows a white screen with this error message "Parse error: parse error, expecting `T_STRING' in C:\wamp\www\drupal\themes\drigg_theme\template.php on line 40"

I felt that the error might be caused by my use of the drigg theme but i still get a white screen when i changed it to the Garland theme. I removed ?

I have attached the drigg theme code with the ddblock proprocess function for anyone to see.That is the theme i really want to use.

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

The function name should be without the brackets []

function [drigg_theme]_preprocess_ddblock_cycle_block_content(&$vars) 

should probably be:

function drigg_theme_preprocess_ddblock_cycle_block_content(&$vars) 

or

function drigg_preprocess_ddblock_cycle_block_content(&$vars) 

depending on what is the name of the theme: drigg_theme or just drigg

Hope this helps you further, please let me know.

greenavus’s picture

Thanks for the quick reply. I changed it as you suggested and the error message and the white screen disappeared.The problem now is that according to the video (18.07mins), once the preprocess function has been done and you refresh your page, you are supposed to see the ddblock with the TOP STORIES icon on the home page of your site but mine comes up with my standard home page with no block.

If there is any relevant information you will require about my setup so far that you think could be causing the problem, please let me know and i will provide it.Because i feel i have followed the video accurately but unfortunately the must be something wrong that i am doing.

ppblaauw’s picture

#4

Can you attach your template.php file and the result of the drupal_set_message debug lines when you uncomment them in the preprocess functions in the template.php file?
A link to the Internet site or the page-source of the page with the ddblock slideshow on your Drupal site would also be helpful.

greenavus’s picture

StatusFileSize
new179.71 KB
new65.58 KB
new95.44 KB

A copy of my template.php file has been attached but prior to sending the previous message, i did not uncomment the drupal_set_message line because according to the video, you should do that if you had an error message.

Also, i went back to the 11min mark to see if i made any mistakes during the setup and at the 11.40mins mark, when i am supposed to configure my ddblock-news item slide show, i get this error message "warning: Invalid argument supplied for foreach() in C:\wamp\www\drupal\includes\form.inc on line 1206." I have attached that section of the argument from the file for you to see as well as the page source.

Thanks a lot for the help you are giving me.

ppblaauw’s picture

#6 You are using the dev version of the ddblock module which is for testing purpose only.
Please download RC6 version of the module, ddblock themes and export file package all for version RC6 of the module

greenavus’s picture

Actually its the recommended version that i downloaded, ddblock-6.x-1.0-rc6.tar, whic measures 230kb when extracted into the modules folder.

greenavus’s picture

WOuld it be better to delete all modules and start again? I hope i don't have to.

greenavus’s picture

You were right about the fact that i was using the dev version and not the recommended version. I have now changed ot to the recommended version but i still have the same problem. When i was reinstalling the modules and going throught he steps in the video, i noticed that she created a theme called my garland and saved everything under this path DRUPAL/SITES/DEFAULT/THEMES/MY GARLAND. Mine on the othere hand is DRUPAL/SITES/THEMES/GARLAND or DRUPAL/SITES/THEMES/DRIGG_THEMES.

I was wondering if the placement of these files could result in me not seeing any change in my website after the preprocess function?

greenavus’s picture

Had the same problem as comment 75 in this thread.Followed his solution and the problem has been solved.http://drupal.org/node/436488

P/S: Drupal is really awesome.

greenavus’s picture

Status: Postponed (maintainer needs more info) » Fixed
ppblaauw’s picture

Title: Preprocess functions cause white screen » Preprocess functions cause white screen and other issues (FIXED)

#8, #9, #10, #11, #12

Great it works now at your installation and thank you for posting your further efforts and solution!!!

Leave the status to fixed, see the original poster made another issue (http://drupal.org/node/689506)
Changed issue title.

Status: Fixed » Closed (fixed)

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