Gibbons escape when setting up form

Hi,

I’m trying to create a custom module. My problem is I’ve been getting the Gibbons have escaped error. I’m still trying to get a grasp on the Gibbon framework architecture. My background is OOP with Symfony.

I’m trying to use the existing invoices_manage_edit code in the finance module since the ui im trying achieve is somewhat similar.

Im getting the error when this part of the code is reached.

$form->setFactory(FinanceFormFactory::create($pdo));
$form->addRow()->addContent(getPaymentLog($connection2, $guid, 'gibbonFinanceInvoice', $gibbonFinanceInvoiceID, null, $feeTotal ?? ''));

The weird thing is the FinanceFormFactory::create nor the $form->setFactory method is not even run when i die the code in there. Im guessing it a permissions problem but i think i already set the actions in the manifest and user permission right.

Hi @pio, welcome to the Gibbon forums, it’s great to hear you’re working on your own custom module :smiley:

It looks like you’ve included some code that comes from other modules, such as the FinanceFormFactory class and getPaymentLog function. These are both auto-loaded into the Finance module through the Gibbon\Module\Finance namespace and the modules/Finance/moduleFunctions.php file. I suspect it may be the class namespace that is causing the fatal error. You can manually load the files using a php include or require_once, if you wish to use those classes/functions. Otherwise, perhaps the default FormFactory or extended DatabaseFormFactory would be of use (which are available in a system-wide namespace).

As a note, when developing, be sure to set your install type to Development in System Admin > System Settings, as this will help ensure you see PHP errors rather than the user-facing “Gibbons escaped” error which is aimed at production servers.

Hope this helps! We also have a Gibbon developers Slack channel, which can be a useful place to ask coding questions. If you’d like an invite, feel free to email support@gibbonedu.org

hi @sandra , thanks for the response. That would make sense. I’ll try to fix this based on your reply.

I just learned about the developer setting, that would be a big help and the a slack channel would be great too. I’ll send an email.

1 Like