JForm::getInstance could not load file on new component development

2,239 views
Skip to first unread message

Ryan Matthews

unread,
Jan 5, 2016, 3:29:35 AM1/5/16
to Joomla! General Development
Hoping to get some guidance on debugging this error. I'm following along the tutorial on how to develop a component in Joomla 3.4.8 (https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_an_install-uninstall-update_script_file) after coming from development of many components in the 2.5.x series, and I'm stumped. I've basically copied the HelloWorld plugin and did a case sensitive find and replace with my component name "DanceReg" to see if I can even get started with this.

I've successfully created the installation package and it install fine, but right after installation and upon loading option=com_dancereg page, I get the error:

JForm::getInstance could not load file

I've enabled Joomla debugging and I get the following call stack; what other coding snippets can I post for you guys to help me debug this? I'm so stumped!

JForm::getInstance could not load file
Call stack
# Function Location
1 JApplicationCms->execute() JROOT/administrator/index.php:47
2 JApplicationAdministrator->doExecute() JROOT/libraries/cms/application/cms.php:252
3 JApplicationAdministrator->dispatch() JROOT/libraries/cms/application/administrator.php:152
4 JComponentHelper::renderComponent() JROOT/libraries/cms/application/administrator.php:98
5 JComponentHelper::executeComponent() JROOT/libraries/cms/component/helper.php:372
6 require_once() JROOT/libraries/cms/component/helper.php:392
7 JControllerLegacy->execute() JROOT/administrator/components/com_dancereg/dancereg.php:31
8 JControllerLegacy->display() JROOT/libraries/legacy/controller/legacy.php:728
9 DanceRegViewDanceRegs->display() JROOT/libraries/legacy/controller/legacy.php:690
10 JError::raiseError() JROOT/administrator/components/com_dancereg/views/danceregs/view.html.php:48
11 JError::raise() JROOT/libraries/legacy/error/error.php:254

Chris Davenport

unread,
Jan 5, 2016, 3:37:24 AM1/5/16
to joomla-de...@googlegroups.com
It's failing to find a form XML file in /models/forms.  Did you remember to rename the form file to match?

Chris.


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.



--
Chris Davenport
Joomla Production Leadership Team

Ryan Matthews

unread,
Jan 5, 2016, 6:30:35 PM1/5/16
to Joomla! General Development
Yup! I think you're referring to this snippet from \models\dancereg.php, which is looking for a 'dancereg.xml' in the \models\forms folder (below). I can also confirm this .xml file is uploaded in this server on the web (pic).

public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm(
'com_dancereg.dancereg',
'dancereg',
array(
'control' => 'jform',
'load_data' => $loadData
)
);

if (empty($form))
{
return false;
}

return $form;
}



<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_dancereg/models/rules"
>
<fieldset
name="details"
label="COM_DANCEREG_DANCEREG_DETAILS"
>
<field
name="dancer_id"
type="hidden"
/>
<field
name="dancer_name"
type="text"
label="COM_DANCEREG_DANCEREG_DANCER_NAME_LABEL"
description="COM_DANCEREG_DANCEREG_DANCER_NAME_DESC"
size="40"
class="inputbox validate-dancer_name"
validate="dancer_name"
required="true"
default=""
/>
<field
name="catid"
type="category"
extension="com_dancereg"
class="inputbox"
default=""
label="COM_DANCEREG_DANCEREG_FIELD_CATID_LABEL"
description="COM_DANCEREG_DANCEREG_FIELD_CATID_DESC"
required="true"
>
<option value="0">JOPTION_SELECT_CATEGORY</option>
</field>
</fieldset>
<fields name="params">
<fieldset
name="params"
label="JGLOBAL_FIELDSET_DISPLAY_OPTIONS"
>
<field
name="show_category"
type="list"
label="COM_DANCEREG_DANCEREG_FIELD_SHOW_CATEGORY_LABEL"
description="COM_DANCEREG_DANCEREG_FIELD_SHOW_CATEGORY_DESC"
default=""
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
<fieldset
name="accesscontrol"
label="COM_DANCEREG_FIELDSET_RULES"
>
        <!--
    <field
name="asset_id"
type="hidden"
filter="unset"
/>
    <field
name="rules"
type="rules"
label="COM_DANCEREG_FIELD_RULES_LABEL"
filter="rules"
validate="rules"
class="inputbox"
component="com_dancereg"
section="message"
/>
        -->
    </fieldset>
</form>








On Tuesday, 5 January 2016 03:37:24 UTC-5, Chris Davenport wrote:
It's failing to find a form XML file in /models/forms.  Did you remember to rename the form file to match?

Chris.
On 5 January 2016 at 02:56, Ryan Matthews <mha...@gmail.com> wrote:
Hoping to get some guidance on debugging this error. I'm following along the tutorial on how to develop a component in Joomla 3.4.8 (https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_an_install-uninstall-update_script_file) after coming from development of many components in the 2.5.x series, and I'm stumped. I've basically copied the HelloWorld plugin and did a case sensitive find and replace with my component name "DanceReg" to see if I can even get started with this.

I've successfully created the installation package and it install fine, but right after installation and upon loading option=com_dancereg page, I get the error:

JForm::getInstance could not load file

I've enabled Joomla debugging and I get the following call stack; what other coding snippets can I post for you guys to help me debug this? I'm so stumped!

JForm::getInstance could not load file
Call stack
#       Function        Location
1       JApplicationCms->execute()      JROOT/administrator/index.php:47
2       JApplicationAdministrator->doExecute()  JROOT/libraries/cms/application/cms.php:252
3       JApplicationAdministrator->dispatch()   JROOT/libraries/cms/application/administrator.php:152
4       JComponentHelper::renderComponent()     JROOT/libraries/cms/application/administrator.php:98
5       JComponentHelper::executeComponent()    JROOT/libraries/cms/component/helper.php:372
6       require_once()  JROOT/libraries/cms/component/helper.php:392
7       JControllerLegacy->execute()    JROOT/administrator/components/com_dancereg/dancereg.php:31
8       JControllerLegacy->display()    JROOT/libraries/legacy/controller/legacy.php:728
9       DanceRegViewDanceRegs->display()        JROOT/libraries/legacy/controller/legacy.php:690
10      JError::raiseError()    JROOT/administrator/components/com_dancereg/views/danceregs/view.html.php:48
11      JError::raise() JROOT/libraries/legacy/error/error.php:254

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.

To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Ryan Matthews

unread,
Jan 5, 2016, 8:59:24 PM1/5/16
to Joomla! General Development
> To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
>
> To post to this group, send an email to joomla-de...@googlegroups.com.
>
> Visit this group at https://groups.google.com/group/joomla-dev-general.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
>
> Chris Davenport
> Joomla Production Leadership Team

Figured out the problem ... my \models\forms\filter_dancereg.xml file should be called \models\forms\filter_danceregs.xml.

You'd think the error message could have been a little more helpful to assist in this debugging process!
Reply all
Reply to author
Forward
0 new messages