Mjoin error
Mjoin error
peterbrowne
Posts: 314Questions: 54Answers: 0
Using Mjoin, I have the error:
Parse error: syntax error, unexpected '[' in /var/www/html/curriculum_mapper/datatables/lib/Editor/Join.php on line 762
Using:
Editor::inst( $db2, 'learning_event', 'learning_event_pk' )
->field(
Field::inst( 'learning_event.learning_event_name' ),
Field::inst( 'learning_event.learning_event_outcome' ),
Field::inst( 'learning_event.rotation_discipline_block_fk' )
->options( Options::inst()
->table( 'rotation_discipline_block' )
->value( 'rotation_discipline_block_pk' )
->label( 'rotation_discipline_block_name' )
),
Field::inst( 'rotation_discipline_block.rotation_discipline_block_name' ),
Field::inst( 'learning_event.rdb_group_fk' )
->options( Options::inst()
->table( 'rdb_group' )
->value( 'rdb_group_pk' )
->label( 'rdb_group_name' )
),
Field::inst( 'rdb_group.rdb_group_name' )
)
->leftJoin( 'rotation_discipline_block', 'rotation_discipline_block.rotation_discipline_block_pk', '=', 'learning_event.rotation_discipline_block_fk' )
->leftJoin( 'rdb_group', 'rdb_group.rdb_group_pk', '=', 'learning_event.rdb_group_fk' )
->join(
Mjoin::inst( 'presentation' )
->link( 'learning_event.learning_event_pk', 'learning_event_presentation_lookup.learning_event_fk' )
->link( 'presentation.presentation_pk', 'learning_event_presentation_lookup.presentation_fk' )
->order( 'presentation.presentation_name asc' )
->fields(
Field::inst( 'presentation_pk' )
->options( Options::inst()
->table( 'presentation' )
->value( 'presentation_pk' )
->label( 'presentation_name' )
),
Field::inst( 'presentation_name' )
)
)
->join(
Mjoin::inst( 'mcondition' )
->link( 'learning_event.learning_event_pk', 'learning_event_mcondition_lookup.learning_event_fk' )
->link( 'mcondition.mcondition_pk', 'learning_event_mcondition_lookup.mcondition_fk' )
->order( 'mcondition.mcondition_name asc' )
->fields(
Field::inst( 'mcondition_pk' )
->options( Options::inst()
->table( 'mcondition' )
->value( 'mcondition_pk' )
->label( 'mcondition_name' )
),
Field::inst( 'mcondition_name' )
)
)
->process($_POST)
->json();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
PHP version is 5.3.3. Yes, I know it's old, but it has been woking so far with DataTables and the Editor.
Alan did supply an update on the code to make editor compatable with 5.3.3:
https://datatables.net/forums/discussion/58132/is-there-a-build-for-editor-that-works-on-php-5-3
Perhaps it might be the Editor/Join.php that should be made compatible at:
See https://healthed.hms.uwa.edu.au/curriculum_mapper/program_data/learning_event_data.php
That isn't valid in PHP 5.3. It should be
array();
.Thanks for pointing that out.
Allan
Fix committed here and it will be in Editor 1.9.3.
Thanks,
Allan
Thanks Allan!