Closed (fixed)
Project:
Computed Field
Version:
6.x-1.0-beta3
Component:
Documentation
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2008 at 01:54 UTC
Updated:
12 Oct 2010 at 20:42 UTC
Jump to comment: Most recent
Comments
Comment #1
dman commentedPaste your code? Probably just syntax error.
Be sure to use full
<?phpopen tags, not just<?Comment #2
bwhazel commentedHi!
Many thanks for the response!
The code I am using is:
$node_field[0]['value'] = $node->field_compoundformula[0]['value'];
Comment #3
doomed commentedGetting the same problem, looking for solution.
Please post if you found something.
Comment #4
Anonymous (not verified) commentedDon't know if anyone is still having this problem, but what was causing this error for me was the fact that the Display Format field was using a WYSIWYG. So the field contained a p tag before the PHP code. Just changed the field to plain text and everything works...
Comment #5
maranello4 commentedI have a very simple code on my test site that just multiplies two integers:
$node_field[0]['value'] = $node->Confidence1[0]['value'] * $node->Confidence2[0]['value'];
And I am getting the same error. When I edit a node and hit 'Save' I get the text below:
Parse error: syntax error, unexpected '<' in C:\...\modules\computed_field\computed_field.module(161) : eval()'d code on line 1
When I load the node thereafter just for viewing I get the same text, but with (297) instead of (161).
Has anything been figured out on this?
Comment #6
maranello4 commentedI figured out the source of my problem - FCKeditor was affecting my "Computed Code" entry space, and was putting in markup. I deactivated FCKeditor, then went back and took the markup out of the Computed Code, and the error disappeared...
Comment #7
mutuku commentedI have the same problem when I run cron jobs manually. I am not using a wysiwyg module. my code is
$node_field[0]['value'] = $node->field_com_1_marks[0]['value']+ $node->field_com_2_marks[0]['value']+$node->field_com_3_marks[0]['value']+$node->field_com_4_marks[0]['value'];
Comment #8
cdonner commentedThis should be put in the help text on the edit field page. The markup is inserted every time I access this page and needs to be removed prior to saving.
Comment #9
Moonshine commentedWYSIWYG editors will create chaos out of PHP code as they try to close >'s and generally "format" your code. This should be disabled within the WYSIWYG module you are using. Most popular ones offer the ability to exclude certain forms and/or paths. I'll add in a little help message to the form text.