-
I have a component that I created in JCB. I have a module that I manually created. I need to use some functions from the component helper class in the module. I can't find a way to access the functions from the module. I've tried require_once but it doesn't seem to work. I either still get function not found or sometimes a 'white screen'. Anyone else ever tried to do this and know the proper way to include/access that helper from external modules? OR should I be creating a library file to handle this sort of thing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK ... found the issue. So the module was running, trying to load the helper file, but the class was already loaded from the site helper file/class, but that class didn't have some of the functions in it that were added directly to the admin helper file. SOLUTION - run a compile. Functions are now there on both site and admin and work as they should. LESSON LEARNED - JCB is very flexible and allows you to make dumb errors like this. (But don't change it! It worked as it should. Just wish I did :-) ) |
Beta Was this translation helpful? Give feedback.
OK ... found the issue.
The problem was that I was manually updating the admin helper file (the section where site and admin custom code goes - directly in the helper php file) and testing on the front-end, but didn't run a compile to push those changes to the front-end helper file as well.
So the module was running, trying to load the helper file, but the class was already loaded from the site helper file/class, but that class didn't have some of the functions in it that were added directly to the admin helper file.
SOLUTION - run a compile. Functions are now there on both site and admin and work as they should.
LESSON LEARNED - JCB is very flexible and allows you to make dumb errors lik…