Undefined property 'name' / unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING
Undefined property 'name' / unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING
agustin_garciaromero
Posts: 42Questions: 0Answers: 0
Hello,
I'm trying to deployed on a just generated Editor example of DataTables, but I'm unable to make it work.
[1]
In my local environment, I'm receiving the following error when I click on New, enter record information and then hit Update button:
"
Notice: Undefined property: DataTables\Editor\Field::$name in C:\SkyDrive\webapps\htdocs\DataTables\php\lib\Editor\Editor.php on line 319
{"id":-1,"error":"","fieldErrors":[{"name":null,"status":null}],"data":[]}
"
[2]
In my live environment (http://a4enterprise.com/DataTables/exp_budget_expenses193.html) I'm receiving a different error, when I just try to load the same page:
"
DataTables warning (table id = 'exp_budget_expenses193'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. "
And the following error is triggered on the HTML Response (FF FireBug's Net XHR section)
"
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/a4enterp/public_html/DataTables/php/table.exp_budget_expenses193.php on line 13
"
Can you please guide on what am I missing?
I have PHP 5.4 on both environments, tried the database connection on both and it works just fine
I'm trying to deployed on a just generated Editor example of DataTables, but I'm unable to make it work.
[1]
In my local environment, I'm receiving the following error when I click on New, enter record information and then hit Update button:
"
Notice: Undefined property: DataTables\Editor\Field::$name in C:\SkyDrive\webapps\htdocs\DataTables\php\lib\Editor\Editor.php on line 319
{"id":-1,"error":"","fieldErrors":[{"name":null,"status":null}],"data":[]}
"
[2]
In my live environment (http://a4enterprise.com/DataTables/exp_budget_expenses193.html) I'm receiving a different error, when I just try to load the same page:
"
DataTables warning (table id = 'exp_budget_expenses193'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. "
And the following error is triggered on the HTML Response (FF FireBug's Net XHR section)
"
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/a4enterp/public_html/DataTables/php/table.exp_budget_expenses193.php on line 13
"
Can you please guide on what am I missing?
I have PHP 5.4 on both environments, tried the database connection on both and it works just fine
This discussion has been closed.
Replies
Any comment on this one?
Thanks
Allan
[code]
<?php
/*
* Editor server script for DB table exp_budget_expenses193
* Automatically generated by http://editor.datatables.net/generator
*/
// DataTables PHP library
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Join,
DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'exp_budget_expenses193' )
->fields(
Field::inst( 'master_id' ),
Field::inst( 'user_id' ),
Field::inst( 'debtor' )
->validator( 'Validate::required' ),
Field::inst( 'type' )
->validator( 'Validate::required' ),
Field::inst( 'category' )
->validator( 'Validate::required' ),
Field::inst( 'creditor' )
->validator( 'Validate::required' ),
Field::inst( 'amount' )
->validator( 'Validate::required' ),
Field::inst( 'due_date' )
->validator( 'Validate::dateFormat_required', 'D, j M y' )
->getFormatter( 'Format::date_sql_to_format', 'D, j M y' )
->setFormatter( 'Format::date_format_to_sql', 'D, j M y' ),
Field::inst( 'bill_reminder' ),
Field::inst( 'lead_days' ),
Field::inst( 'periodicity' ),
Field::inst( 'automatic_tracking' ),
Field::inst( 'linked_account' ),
Field::inst( 'associated_jar' ),
Field::inst( 'memo' )
)
->process( $_POST )
->json();
[/code]
[/cp
[code]
echo phpversion();
[/code]
at the top of the file, what does the server then return? (just a sanity check)
Allan
PHPVersion :5.4.4
{"id":-1,"error":"","fieldErrors":[],"data":[],"aaData":[]}
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '('
on line 13
and my php version is 5.4.6.
Is there anything to do?
[code] use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Join,
DataTables\Editor\Validate;[/code]
put:
[code]use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Format;
use DataTables\Editor\Join;
use DataTables\Editor\Validate;
[/code]
it works fine for me i hope this will help you.
Allan
I'm trying to put both buttons for add/edit/delete ans the swf for copy/excel/pdf export but i can't ?
Is it possible to put them together or not?
Allan
I'm using this :
[code]"oTableTools": {
"sSwfPath": "TableTools/swf/copy_csv_xls_pdf.swf" ,
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
},[/code]
if i remove de aButtons, i can see the swf in place of the buttons, but if i leave the abutons code, my swf dissapear, seems like they are in the same place. I want the swf to be at the right of the search input.
"oTableTools": {
"sSwfPath": "TableTools/swf/copy_csv_xls_pdf.swf" ,
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor },
'csv',
'copy' // etc
]
},
[/code]
Allan