Closed (fixed)
Project:
Framework
Version:
7.x-3.4
Component:
PHP code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2011 at 17:30 UTC
Updated:
2 Feb 2017 at 10:52 UTC
Jump to comment: Most recent
Framework 7.x-3.4
I have created a subtheme in the usual fashion but get this error
Warning: Invalid argument supplied for foreach() in theme_links() (line 1441 of /home/karljaco/public_html/includes/theme.inc).
Warning: Invalid argument supplied for foreach() in theme_links() (line 1441 of /home/karljaco/public_html/includes/theme.inc).
any ideas on how to clear it?
Comments
Comment #1
brettm commentedI'm getting the same error. Any solution?
Comment #2
checker commentedI have the same error and it happens in framework_preprocess_page() in template.php. I'm using a sub theme.
Comment #3
elpino commentedMy fix was to delete all functions from template.php copied from the original template files leaving only
<?php
Maybe deleting the file altogether if you aren't using it will work too.
I was accustomed to renaming functions with my own theme name, maybe template_preprocess_page() has an issue being redefined in the same way twice... I dunno.
Comment #4
elpino commentedComment #5
tim.plunkettIn the parent theme,
template_preprocess_page()passes the array$vars['main_menu']totheme_links__system_main_menu(), and then overwrites$vars['main_menu']with the resulting string. The subtheme comes with the same code, except now instead of being an array,$vars['main_menu']is a string, hence the error.Core and Zen get around this by calling
theme_links__system_main_menu()directly in the page.tpl.php, which isn't necessarily the best solution. One way to fix this would be something like this:In the parent theme:
In the sub theme:
Comment #6
andregriffin commentedI see. The next version of Framework will use the default method of rendering the menus. The D6 branch already does this, and the next release of the D7 branch will be identical to what is found in the "Stark" page.tpl.
Comment #7
andregriffin commentedComment #8
andregriffin commentedfixed in 3.6
Comment #9
tim.plunkettPlease read over http://drupal.org/node/52287, it explains how to write proper commit messages. Each fix from each issue should have a separate commit with a descriptive message.
Comment #10
andregriffin commentedYeah, my working habits are probably not too great in this regard. Currently, I make changes as I see fit, address any open issues, and generally get the new incarnation into a state that's release-ready. Then I write up a rough list of changes, and commit the whole thing. That probably sounds nightmarish for thorough developers and users. I'll change my ways after I push this D6 port of the 7x branch.
Comment #12
payamspot commentedThanks elpino. Deleting everything except "<?php" in template.php did the work.
Comment #13
hairidine commented