I was able to open a form within a modal from a Module list (Ajaxify Links) in Joomla 4, Fabrik 4.0Zeta, but since updating to Joomla 4.4 and Fabrik4.1, I cannot get a Fabrik form (neither add nor edit) to load within a modal from a list module. I am currently, using Joomla 5.2 and Fabrik 4.4.1.
I created a list for Licenses and a list for Documents (documents that are associated to a license). Within the apps_documents table, there is a field element named "parent_id" and the value is the "id" of an associated license from the apps_licenses table "id" element. I don't have the app_documents table joined within the Licenses list, because there are a lot of records, several columns (elements) in each table and some of those elements are cascading drop-downs.
From past experience, I have had too many problems with forms failing to open because the join queries take up too much memory and cause page timeout issues (especially when there are several cascading drop-downs involved). Instead, I've created a page that loads a Fabrik form module pointing to my apps_licenses table, then below the Licenses form module, I added a Fabrik List module that loads the Documents list with a pre-filter where the "parent_id" element of a apps_documents row is equal to the "{rowid}" within the URL of the page (that loads the Licenses form). The page loading the Licenses Form and Documents List, it is only accessible if there is an existing License record...
When I had first setup my page (using Joomla 4.2 and Fabrik 4.0Zeta), I was able to have a custom "Add" link within the Documents list that included: "&parent_id={rowid}" and within the "parent_id" field element of the Documents form, I included the following script in the "Defaul" textarea (with Eval set to "Yes"):
$myInput = JFactory::getApplication()->input;
$myParam = $myInput->get('parent_id','');
return $myParam;
This way, I can "Add" a new document that needs to be associated to a License by passing the {rowid} from the the opened Licenses form URL as the "parent_id" for the document record.
Within the Documents list module's "Advanced" settings, I had both the "Ajaxify" and "Ajaxify Links" options set to "Yes" and it used to open the Documents form (in either "Add" or "Edit") within a modal (which was ideal for the UI/UX I was trying to present). Upon "Save" within the Documents form (within the modal), the modal would close and I'd get a "Record Saved" confirmation displayed at the top of the page.
I don't know if it is a Joomla or Fabrik issue (I updated to Joomla 4.4, then Fabrik to 4.1, but didn't notice this issue until several days after I had done the updates), but the ajax request now fails to open the Documents form within the modal. The server response to the ajax request is a code 500. When I open the requested url, I'm presented with the message: "Unable to load renderer class metas".
The URL that the request is trying to open is: https://mysite.com/index.php/compon...nt_id=42&tmpl=component&ajax=1&format=partial.
I had originally suspected that it was an SEF (url rewriting) issue, but when disabling SEF in Joomla's Global Config -> Site settings, I still get the same error.
Within the Fabrik Module "Advanced" settings for the Documents list, if I keep "Ajaxify" set to "Yes", but "Ajaxify Links" set to "No", then the "Add" or "Edit" buttons in the Documents list open the Documents form in a new window and work as expected (parent_id is populated correctly using the {parent_id} value passed in the URL https://mysite.com/component/fabrik/form/8/?Itemid=138&parent_id=42). The url parameters tmpl=component, ajax=1 and format=partial aren't included when opening the page in a new window (expected, but perhaps the issue is related to one of the parameters?)
For now, I have a work-around (just opening the form in a new window rather than a modal), but would prefer to use the modal as my preferred UI/UX if I could.
Any ideas?
I created a list for Licenses and a list for Documents (documents that are associated to a license). Within the apps_documents table, there is a field element named "parent_id" and the value is the "id" of an associated license from the apps_licenses table "id" element. I don't have the app_documents table joined within the Licenses list, because there are a lot of records, several columns (elements) in each table and some of those elements are cascading drop-downs.
From past experience, I have had too many problems with forms failing to open because the join queries take up too much memory and cause page timeout issues (especially when there are several cascading drop-downs involved). Instead, I've created a page that loads a Fabrik form module pointing to my apps_licenses table, then below the Licenses form module, I added a Fabrik List module that loads the Documents list with a pre-filter where the "parent_id" element of a apps_documents row is equal to the "{rowid}" within the URL of the page (that loads the Licenses form). The page loading the Licenses Form and Documents List, it is only accessible if there is an existing License record...
When I had first setup my page (using Joomla 4.2 and Fabrik 4.0Zeta), I was able to have a custom "Add" link within the Documents list that included: "&parent_id={rowid}" and within the "parent_id" field element of the Documents form, I included the following script in the "Defaul" textarea (with Eval set to "Yes"):
$myInput = JFactory::getApplication()->input;
$myParam = $myInput->get('parent_id','');
return $myParam;
This way, I can "Add" a new document that needs to be associated to a License by passing the {rowid} from the the opened Licenses form URL as the "parent_id" for the document record.
Within the Documents list module's "Advanced" settings, I had both the "Ajaxify" and "Ajaxify Links" options set to "Yes" and it used to open the Documents form (in either "Add" or "Edit") within a modal (which was ideal for the UI/UX I was trying to present). Upon "Save" within the Documents form (within the modal), the modal would close and I'd get a "Record Saved" confirmation displayed at the top of the page.
I don't know if it is a Joomla or Fabrik issue (I updated to Joomla 4.4, then Fabrik to 4.1, but didn't notice this issue until several days after I had done the updates), but the ajax request now fails to open the Documents form within the modal. The server response to the ajax request is a code 500. When I open the requested url, I'm presented with the message: "Unable to load renderer class metas".
Call Stack
# | Function | Location |
---|---|---|
1 | () | JROOT/libraries/src/Document/Factory.php:101 |
2 | Joomla\CMS\Document\Factory->createRenderer() | JROOT/libraries/src/Document/Document.php:1128 |
3 | Joomla\CMS\Document\Document->loadRenderer() | JROOT/libraries/fabrik/fabrik/fabrik/Document/PartialDocument.php:468 |
4 | Fabrik\Document\PartialDocument->getBuffer() | JROOT/libraries/fabrik/fabrik/fabrik/Document/PartialDocument.php:793 |
5 | Fabrik\Document\PartialDocument->_renderTemplate() | JROOT/libraries/fabrik/fabrik/fabrik/Document/PartialDocument.php:568 |
6 | Fabrik\Document\PartialDocument->render() | JROOT/libraries/src/Application/CMSApplication.php:1073 |
7 | Joomla\CMS\Application\CMSApplication->render() | JROOT/libraries/src/Application/SiteApplication.php:732 |
8 | Joomla\CMS\Application\SiteApplication->render() | JROOT/libraries/src/Application/CMSApplication.php:311 |
9 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/includes/app.php:58 |
10 | require_once() | JROOT/index.php:32 |
The URL that the request is trying to open is: https://mysite.com/index.php/compon...nt_id=42&tmpl=component&ajax=1&format=partial.
I had originally suspected that it was an SEF (url rewriting) issue, but when disabling SEF in Joomla's Global Config -> Site settings, I still get the same error.
Within the Fabrik Module "Advanced" settings for the Documents list, if I keep "Ajaxify" set to "Yes", but "Ajaxify Links" set to "No", then the "Add" or "Edit" buttons in the Documents list open the Documents form in a new window and work as expected (parent_id is populated correctly using the {parent_id} value passed in the URL https://mysite.com/component/fabrik/form/8/?Itemid=138&parent_id=42). The url parameters tmpl=component, ajax=1 and format=partial aren't included when opening the page in a new window (expected, but perhaps the issue is related to one of the parameters?)
For now, I have a work-around (just opening the form in a new window rather than a modal), but would prefer to use the modal as my preferred UI/UX if I could.
Any ideas?
Last edited: