Override save(), and skip the table?

104 views
Skip to first unread message

Mike Pearl

unread,
Nov 9, 2016, 2:28:27 PM11/9/16
to Joomla! General Development
How can I create a model supporting a form without a Table?

All the data from this particular view is being stored in a graph database (Neo4j), not MySQL.  In the model I created a save() function which saves the data in Neo4j, and I didn't create a Table file.  Still, when I save the form, Joomla bombs out, looking for a table with this error:

Table viewname not supported.  File not found.


Here's the Call stack


#Function Location
1JApplicationCms->execute() /var/www/gs/index.php:49
2JApplicationSite->doExecute() /var/www/gs/libraries/cms/application/cms.php:261
3JApplicationSite->dispatch() /var/www/gs/libraries/cms/application/site.php:230
4JComponentHelper::renderComponent() /var/www/gs/libraries/cms/application/site.php:191
5JComponentHelper::executeComponent() /var/www/gs/libraries/cms/component/helper.php:380
6require_once() /var/www/gs/libraries/cms/component/helper.php:405
7JControllerLegacy->execute() /var/www/gs/components/com_gs/gs.php:12
8JControllerForm->save() /var/www/gs/libraries/legacy/controller/legacy.php:702
9JModelLegacy->getTable() /var/www/gs/libraries/legacy/controller/form.php:617


Joomla doesn't even get to my save() override.  What am I doing wrong?

Thanks!

Michael Babker

unread,
Nov 9, 2016, 2:32:50 PM11/9/16
to joomla-de...@googlegroups.com
Did you override the controller method as well?  The stack trace shows it's using the JControllerForm::save() method which does use a JTable object, so you'll need to override the controller to remove the pieces you don't need.

--
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 email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

John Rallis

unread,
Dec 15, 2016, 11:40:32 AM12/15/16
to Joomla! General Development
I am having a similar issue with my custom component although in my case i also have the same error on the view->display()
I am on the administrator area and have a view with a form, thus a controller extending JControllerForm

Have you resolved your issue? Would you mind sharing some of your code?

I have temporarily overcome this by creating a dummy table but i am sure there is a better way!
Reply all
Reply to author
Forward
0 new messages