Hi All,
I've been using this code from the AppGini Tutorials in my hooks for an invoice:
// modify the status field of the table view query to display 'Due' invoices in bold red
// $oldArray=$options->QueryFieldsTV;
// $options->QueryFieldsTV='';
// foreach($oldArray as $field => $caption){
// if($field=='`commercial`.`status`'){
// $options->QueryFieldsTV['IF(`commercial`.`status`=\'Due\', \'<b style="color: red; background: white">Due</b>\', IF(`commercial`.`status`=\'Paid\', \'<b style="color: green; background: white">Paid</b>\', `commercial`.`status`))']=$caption;
// }
// else{
// $options->QueryFieldsTV[$field]=$caption;
// }
// }
It's been working fine without any issues until I upgraded from PHP5.6 to PHP7.2 as recommended by my service provider. After upgrade I get a stream of error messages:
Warning: Illegal string offset '`commercial`.`id`' in /homepages/5/d106639433/htdocs/web4u0/hooks/commercial.php on line 37
Warning: Illegal string offset 'IF( CHAR_LENGTH(`webdata1`.`user`), CONCAT_WS('', `webdata1`.`user`), '') /* clientusername */' in /homepages/5/d106639433/htdocs/web4u0/hooks/commercial.php on line 37
Warning: Illegal string offset 'IF( CHAR_LENGTH(`webdata1`.`title`) || CHAR_LENGTH(`webdata1`.`company`), CONCAT_WS('', `webdata1`.`title`, ' - ', `webdata1`.`company`), '') /* Client */' in /homepages/5/d106639433/htdocs/web4u0/hooks/commercial.php on line 37
I've stepped back to PHP7.1 same errors, then PHP7.0 and working again
Just thought I'd point this out in case anyone else uses same code from shown above in any of their projects.
Does anyone have a fix for this?
PHP7.0 has PHP community support until 12/2018 - so bit of time yet!!
Cheers, Ron
Highlighting Specific Records
Highlighting Specific Records
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Highlighting Specific Records
Hi,
can you try to initialize your arrary and see.
Change
$options->QueryFieldsTV='';
to
$options->QueryFieldsTV=[];
can you try to initialize your arrary and see.
Change
$options->QueryFieldsTV='';
to
$options->QueryFieldsTV=[];
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Highlighting Specific Records
Hi PBöttcher,
Tried your suggestion with both PHP7.1 & PHP7.2 - WORKING ON BOTH
Thank you very much for instant response, suggest the tutorial example is updated to show the same (who does that?)
Thanks again,
Ron
Tried your suggestion with both PHP7.1 & PHP7.2 - WORKING ON BOTH
Thank you very much for instant response, suggest the tutorial example is updated to show the same (who does that?)
Thanks again,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course