We had a report come in today that baffles me. One of our users noticed that if they perform a search on our main website for the term trial without any special characters or anything I would expect to throw an exception on this poorly coded piece of crap (company website I inherited administration of from some prior morons).

We receive the below error. Does anyone have any idea where to start troubleshooting?

Fatal error: Cannot redeclare my_module_form_submit() (previously declared in /var/www/html/includes/common.inc(1743) : eval()'d code:124) in /var/www/html/includes/common.inc(1743) : eval()'d code on line 23

I examined the file mentioned and found this on line 23:

*/

To give a little more detail around that line here is the specific section of the file:

/**
 * Return status for saving which deleted an existing item.
 */
define('SAVED_DELETED', 3);

Comments

nevets’s picture

Why it would only happen on that term is odd, but the error telling you my_module_form_submit() is redefined comes from three likely possible sources.

a) Someone has used PHP code is a node and defined a function which can produce the error.

b) It is really redefined in a module or theme file though I would expect this all the time. I would grep/search for the function in all the files that are part of the site.

c) Someone is directly including the file with my_module_form_submit() in it when they should not be.

Jaypan’s picture

I'd say it's A, as the error is coming from eval() code. eval() is called when parsing nodes created with the PHP input filter.

Someone has added a function named my_module_form_submit() in one of your nodes. This node likely has the word 'trial' in it. As this node is found by the search, it is attempted to be displayed in the search results, and the function my_module_form_submit() in the node is causing an error, since the function my_module_form_submit() already exists in code.

taslett’s picture

Search the database for trial or my_module_form_submit in nodes: field_data_body and blocks: block_custom to find out where error is coming from.