Theresa Arzadon-Labajo | ||||
Menu:
Powered by Website Baker |
I looked in error_log and it was showing a 500 error. php.log was showing "PHP Fatal error: Cannot redeclare mymail() (previously declared..." I renamed the function, but I got the same error again for the new function name. On one page node, I include a php file using the PHP filter module. On http://drupal.org/node/32963, kiz_0987 said: "Be careful with just using include. If you have 2 nodes that use the same function then viewing each separately will be OK, but anytime you view the two together (eg via taxonomy) or with cron.php you may get a redeclare error. Use include_once instead." Also, javanaut said: "I would suggest putting your code in a separate .inc file and including it from your settings.php file. The default settings file is in sites/default/settings.php. If you created the file sites/default/myfunctions.php, you could included it from settings.php as:So, I took the function out of my include file and copied it into sites/default/myfunctions.php. Instead of adding the include to settings.php, where it would be included everywhere, I added "include_once('myfunctions.php');" in my include file.<?php Drupal Search seems to work consistently now. Last changed: Feb 27 2020 at 4:13 PM Back |
|||