Saving code in a file

Amir Simantov - November 4, 2009 - 13:00
Project:Computed Field
Version:6.x-1.0-beta3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

In the description under "Computed Code" I understand that I can put the code in a file and then call the appropriate function. However, I do not succeed to do so.

I have put the code outside in a file (in my theme) following the description: "Alternately, this code can be supplied by your own custom function named computed_field_field_event_hebrew_date_compute()."

When trying to use the field, i.e., when editing a node of a type which has the computed field I get a fatal error: Cannot redeclare computed_field_field_event_hebrew_date_compute() (previously declared in /home/amir/domains/kehilotsharot.org.il/public_html/sites/all/themes/tendu/custom_functions.php:5) in /home/amir/domains/kehilotsharot.org.il/public_html/sites/all/themes/tendu/custom_functions.php on line 17

which means that the method in the file is indeed recognized but it seems that computed field tries to re-declare it.

If I go to edit the computed field itself, I see that the default code has been entered to it:
$node_field[0]['value'] = "";

Any help will be appreciated. Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.