parent.php 'Use of undefined constant' error

Bauer

Well-Known Member
This (cut and paste of the backtraced error) has had me scratching my head for months...

Backtrace from warning
Use of undefined constant COM_FABRIK_LIBRARY - assumed 'COM_FABRIK_LIBRARY' at
/home/public_html/components/com_fabrik/helpers/parent.php 2439:
/home/public_html/index.php 51 calling execute() |
/home/public_html/libraries/cms/application/cms.php 271 calling render() |
/home/public_html/libraries/cms/application/site.php 777 calling render() |
/home/public_html/libraries/cms/application/cms.php 1116 calling render() |
/home/public_html/libraries/joomla/document/html.php 552 calling _renderTemplate() |
/home/public_html/libraries/joomla/document/html.php 777 calling getBuffer() |
/home/public_html/libraries/joomla/document/html.php 486 calling render() |
/home/public_html/libraries/joomla/document/renderer/html/modules.php 42 calling render() |
/home/public_html/libraries/joomla/document/renderer/html/module.php 93 calling renderModule() |
/home/public_html/libraries/cms/module/helper.php 198 calling include() |
/home/public_html/modules/mod_fabrik_list/mod_fabrik_list.php 165 calling display() |
/home/public_html/components/com_fabrik/views/list/view.html.php 41 calling display() |
/home/public_html/components/com_fabrik/views/list/view.base.php 504 calling canPdf() |
/home/public_html/components/com_fabrik/helpers/parent.php 2439 calling process_error_backtrace()

You think this might explain a few mysterious problems - especially anything related to rendering PDFs that are throwing a COM_FABRIK_NOTICE_DOMPDF_NOT_FOUND error?

A search found that the COM_FABRIK_LIBRARY constant is being referenced in...
components/com_fabrik/helpers/parent.php
plugins/fabrik_element/fileupload/models/flash.php
plugins/fabrik_element/fileupload/models/video.php
plugins/system/fabrik/defines.php

I was looking into this for 4 hours. I could see that the constant is initialized in plugins/system/fabrik/defines.php, so I was lost as to why the error - until I realized there is both a 'defines.php' and a 'user_defines.php' - and this constant is missing in the user_defines.php.

Anyhow (I believe) the simple fix is to insert this line at line 27 of plugins/system/fabrik/user_defines.php
PHP:
define("COM_FABRIK_LIBRARY", COM_FABRIK_BASE . 'libraries/fabrik');
 
Last edited:
Do you have "Allow user defines" set to Yes in the "Global" tab of the main Fabrik global options?

-- hugh
Of course I did, duhh. You're a genius!:D

I hate when I get stumped on something that is so simple - especially when I start blaming 'others', sorry.:oops:
I don't give up easy - and that only adds to my rage and frustration.
(I suppose you should get all that by now - and please, just take it with a grain of salt.)
 
All I shall add to that is from the tooltip on that option ... "DO NOT use this feature unless you know what you are doing!".

;)

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top