Custom Hook in ListView Task Module issue

Hello, i encountered a problem why creating custom hook. I wanted to change colors in list view custom module depending on due date. I was reading the technical blog to understand it

So i made step by step and made code below

public/legacy/custom/Extensions/modules/Tasks/Ext/LogicHooks/ListViewHighlight.php

<?php $hook_array['process_record'][] = Array( 1, 'Highlight Task Due Date', 'custom/modules/Tasks/HighlightDueDateLogicHook.php', 'HighlightDueDateLogicHook', 'highlightDueDate' );

and public/legacy/custom/modules/Task/HighlightDueDateLogicHook.php

<?php class HighlightDueDateLogicHook { public function highlightDueDate(SugarBean $bean, $event, $arguments) { $dueDate = strtotime($bean->date_due); $today = strtotime(date('Y-m-d')); if ($dueDate < $today) { $color = '#31708F'; } elseif ($dueDate == $today) { $color = '#8A6D3B'; } $bean->date_due = "
".$bean->date_due."
"; } }

and after Quick and Rebuild i got the next result - due date column is blank and i dont know how to fix that. Has anyone else know the fix?? Thank you in advance

P.S. I dont know why when i paste code its not correctly looks. I tried to add space but it doesnt work. Sorry for that

Docs is about SuiteCRM v7.x and you’re using v8.x

You need to clear symfony cache and clear cache from the browser.

Also, maybe you need your module to be in legacy mode.

Hello, thank you for the answer!
How can i clear symfony cache? And make Task Module be in legacy mode?

File At:

SuiteCRM-Core/config/services/module /module_routing.yaml

tasks:
  index: true // true means suite 8 view
  list: true
   record: false // false means classic view

To overcome the above error you need to clear symfony cache by running next command on your SuiteCRM 8 instance root:

 ./bin/console cache:clear

Or

php ./bin/console cache:clear