3

I wrote a list cell filter class and put it in component directory of the core plugin orangehrm:

...\orangehrm-3.3.3\symfony\plugins\orangehrmCorePlugin\lib\component\MyCellFilter.php

but when referencing the filter in lists it dose not work

I checked the orangehrm log and the error message says:

PHP Fatal error: Class 'MyCellFilter' not found

Could someone tell me where and how to define this filter class?

Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
  • If it's a Symfony 1.4 project, the filename might need to be MyCellFilter.class.php in order for the autoloader to find it. – Kris Peeling Feb 22 '17 at 20:30
  • Thanks, I changed the name of the file still still no luck but your answer pointed me to the right direction. Ithink the problem is that the file is not registerd so i'll check the autoload file – aiman M Ali. Feb 23 '17 at 09:23
  • You also need to clear the symfony cache after changing the filename if you're in the prod environment. In dev environment clearing the cache should not be necessary. – Kris Peeling Feb 23 '17 at 17:09
  • It Worked! Thanks Kris, Thank you Very much. Just like you said it was the config_autoload.yml file not including the path as soon as I deleted it the my php worked like magic again thank you very much please post this as answer so I could mark as the correct answer and up-vote it – aiman M Ali. Feb 23 '17 at 18:26

1 Answers1

1

The autoloader in Symfony 1.4 looks for class files with a *.class.php extension by default.

Change the filename to MyCellFilter.class.php and then clear the symfony cache with the php symfony cc command at the root of the project, or manually delete the files in the cache folder (not required in the dev environment, the cache is recreated on every request).

After the next request, you can verify that the class was autoloaded by looking for it in cache/project_autoload.cache and also check for the class path in the cache/your_app/config/config_autoload.yml.php file.

Kris Peeling
  • 1,025
  • 8
  • 18