Cannot redeclare sencillo_get_node_count()

7 posts / 0 new
Last post
jabbott
jabbott's picture
Cannot redeclare sencillo_get_node_count()

Hey there.
I have a fresh install of the template that I just did. The install seemed to work perfect. The site was working once I was done with it. Then I did an upgrade of all modules and now I get this error:

[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP Fatal error: Cannot redeclare sencillo_get_node_count() (previously declared in /web/abbotts/sites/all/themes/sencillo_2/template.php:144) in /web/abbotts/sites/all/themes/sencillo_2_artwork/template.php on line 149
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP Stack trace:
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 1. {main}() /web/abbotts/index.php:0
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 2. drupal_bootstrap() /web/abbotts/index.php:20
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 3. _drupal_bootstrap_full() /web/abbotts/includes/bootstrap.inc:2262
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 4. module_invoke_all() /web/abbotts/includes/common.inc:5245
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 5. call_user_func_array:{/web/abbotts/includes/module.inc:895}() /web/abbotts/includes/module.inc:895
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 6. colorbox_init() /web/abbotts/includes/module.inc:895
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 7. _colorbox_doheader() /web/abbotts/sites/all/modules/colorbox/colorbox.module:61
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 8. libraries_load() /web/abbotts/sites/all/modules/colorbox/colorbox.module:226
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 9. libraries_detect() /web/abbotts/sites/all/modules/libraries/libraries.module:635
[Mon Jul 06 16:44:22 2015] [error] [client 10.0.2.2] PHP 10. libraries_info() /web/abbotts/sites/all/modules/libraries/libraries.module:496

Any idea what could be going on?

--ja

jabbott
jabbott's picture
What I did to get this to

What I did to get this to work was to comment out a section in two files:
sites/all/themes/sencillo_2/template.php
sites/all/themes/sencillo_2_artwork/template.php

/* commented by abbott
function sencillo_get_node_count($content_type) {
$query = "SELECT COUNT(*) amount FROM {node} n ".
"WHERE n.type = :type";
$result = db_query($query, array(':type' => $content_type))->fetch();
return $result->amount;
}
*/

This seems to allow the template to work. But I don't know the implications of what I have done.

--ja

support
support's picture
Hi there Jabbot:

Hi there Jabbot:

Thanks for sharing! By reviewing it quickly, there should be none.

Best!!!

support
support's picture
Anyway, try to disable the

Anyway, try to disable the one you are not using. Maybe there is the conflict.

Best!!!

jabbott
jabbott's picture
Getting an error.

I have run across a problem with this. The portfolio explorer no longer works. I am not sure what you mean about disabling the one I am not using. Basically I found to disable these two by looking at the apache log. The site would not work at all (white page of death) until I commented out this function in both of these files.

Now however I am getting this error when I click to view a portfolio:

[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP Fatal error: Call to undefined function sencillo_get_node_count() in /web/abbotts/sites/all/themes/sencillo_2/templates/views-view-summary--portfolio-albums-view.tpl.php on line 17, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP Stack trace:, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 1. {main}() /web/abbotts/index.php:0, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 2. menu_execute_active_handler() /web/abbotts/index.php:21, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 3. call_user_func_array:{/web/abbotts/includes/menu.inc:519}() /web/abbotts/includes/menu.inc:519, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 4. views_page() /web/abbotts/includes/menu.inc:519, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 5. view->execute_display() /web/abbotts/sites/all/modules/views/views.module:540, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 6. views_plugin_display_page->execute() /web/abbotts/sites/all/modules/views/includes/view.inc:1345, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 7. view->build() /web/abbotts/sites/all/modules/views/plugins/views_plugin_display_page.inc:217, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 8. view->attach_displays() /web/abbotts/sites/all/modules/views/includes/view.inc:1061, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 9. views_plugin_display_attachment->attach_to() /web/abbotts/sites/all/modules/views/includes/view.inc:1432, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 10. view->execute_display() /web/abbotts/sites/all/modules/views/plugins/views_plugin_display_attachment.inc:238, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 11. views_plugin_display_attachment->execute() /web/abbotts/sites/all/modules/views/includes/view.inc:1345, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 12. view->render() /web/abbotts/sites/all/modules/views/plugins/views_plugin_display_attachment.inc:32, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 13. views_plugin_display->render() /web/abbotts/sites/all/modules/views/includes/view.inc:1264, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 14. theme() /web/abbotts/sites/all/modules/views/plugins/views_plugin_display.inc:2605, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 15. template_preprocess_views_view() /web/abbotts/includes/theme.inc:1125, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 16. views_plugin_style_summary->render() /web/abbotts/sites/all/modules/views/theme/theme.inc:49, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 17. theme() /web/abbotts/sites/all/modules/views/plugins/views_plugin_style_summary.inc:74, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 18. theme_render_template() /web/abbotts/includes/theme.inc:1208, referer: http://127.0.0.1:8080/
[Tue Jul 07 14:32:17 2015] [error] [client 10.0.2.2] PHP 19. include() /web/abbotts/includes/theme.inc:1525, referer: http://127.0.0.1:8080/

jabbott
jabbott's picture
Ok, I was able to get this working

I was able to fix this by commenting out this same function in: sites/all/themes/sencillo_2_explode/template.php and uncommenting it (reversing the change I made in the second post of this thread) in the file: sites/all/themes/sencillo_2/template.php So now this last file is the only one that has this function in it.

Why is this function in more than one place and what changed in Drupal to cause this to now be an issue? It seems like you will need to make this change in your Sincillo distro.

--ja

support
support's picture
Hi there Habbott:

Hi there Habbott:

You are right! Thing is that as all themes are just clones, the issue comes out when you have 2 enabled at the same time.

Thanks for the tip!

Log in to post comments