Table not supported. File not found.

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
dennismonsewicz
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Tue Nov 25, 2008 8:40 pm

Table not supported. File not found.

Post by dennismonsewicz » Wed Nov 26, 2008 4:54 am

i am getting the following error when i try to edit an entry...

Table phoneplan not supported. File not found.

This is my Edit function

Code: Select all

function edit()
	{
		$cid = JRequest::getVar('cid', array(), 'request', 'array');
		
		$row =& JTable::getInstance('phoneplan', 'Table');
					
		if (isset($cid[2])) {
			$row->load($cid[2]);
		}
		
		require_once(JPATH_COMPONENT.DS.'admin.attdeductible.html.php');
		$option = JRequest::getCmd('option');
		HTML_AttDeductible::edit($option, $row);
	}

PCSpectra
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Oct 14, 2008 6:03 am
Contact:

Re: Table not supported. File not found.

Post by PCSpectra » Thu Dec 11, 2008 6:03 am

I'm getting a similar error just when calling:

$this->getTable('accounts')

I've triple checked all conventions and still...no dice?
Started playing with Joomla on a client request and now I'm strongly considering converting my own web site. I'm liking what I see so far. :)

www.pcspectra.com PCSpectra :: Professional, Affordable PHP Programming, Web Development and Documentation

germi
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed Dec 24, 2008 1:02 pm

Re: Table not supported. File not found.

Post by germi » Wed Jan 21, 2009 10:35 am

I'm getting the same error, just on calling:

$this->getTable();

coolbung
Joomla! Guru
Joomla! Guru
Posts: 552
Joined: Sat Nov 11, 2006 5:03 am
Contact:

Re: Table not supported. File not found.

Post by coolbung » Wed Jan 21, 2009 10:48 am

You need to add the table path to the list of include paths. You need to put the following code

Code: Select all

JTable::addIncludePath('path'.DS.'to'.DS.'tables');
In the entry file of your component. This means the componentname.php (or admin.componentname.php) file in the folder for that component.

Once you do this, you can easily use -

Code: Select all

$instance = $this->getTable();
OR

Code: Select all

$instance = $this->getTable('filename');
To get an instance of a table other than the current model name
Ashwin K. Date - Follow @coolbung @tekdinet @techjoomla @jugpune
Joomla! Extensions & Training - www.techjoomla.com

bkarthik
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Apr 01, 2008 10:43 am

Re: Table not supported. File not found.

Post by bkarthik » Tue Mar 03, 2009 8:43 am

Im also having this problem... the tables folder contains 5 files and 4 of hem are included...only one file wsnt included?
why?

coolbung
Joomla! Guru
Joomla! Guru
Posts: 552
Joined: Sat Nov 11, 2006 5:03 am
Contact:

Re: Table not supported. File not found.

Post by coolbung » Tue Mar 03, 2009 8:50 am

What are the file names and the class names of the 5 files?
Ashwin K. Date - Follow @coolbung @tekdinet @techjoomla @jugpune
Joomla! Extensions & Training - www.techjoomla.com

bkarthik
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Apr 01, 2008 10:43 am

Re: Table not supported. File not found.

Post by bkarthik » Tue Mar 03, 2009 8:50 am

SORRY the problem was sum spelling mistake in class names..... thanks.

xavip
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Mon Jan 19, 2009 5:33 pm

Re: Table not supported. File not found.

Post by xavip » Thu Mar 12, 2009 12:31 pm

Yes I have the same problem

this is very frustrating

if i change the table it works, in the same model!

Sparky9292
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Sat Jun 13, 2009 11:21 pm

Re: Table not supported. File not found.

Post by Sparky9292 » Tue Dec 15, 2009 3:56 pm

dennismonsewicz wrote:i am getting the following error when i try to edit an entry...

Table phoneplan not supported. File not found.

This is my Edit function

Code: Select all

function edit()
	{
		$cid = JRequest::getVar('cid', array(), 'request', 'array');
		
		$row =& JTable::getInstance('phoneplan', 'Table');
					
		if (isset($cid[2])) {
			$row->load($cid[2]);
		}
		
		require_once(JPATH_COMPONENT.DS.'admin.attdeductible.html.php');
		$option = JRequest::getCmd('option');
		HTML_AttDeductible::edit($option, $row);
	}
You are missing the addIncludePath call. Probably should put it somewhere in the call to this method.

Code: Select all

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
Where tables is the folder name in your com_phoneplan directory.

poohzard
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jan 06, 2010 12:22 pm

Re: Table not supported. File not found.

Post by poohzard » Wed Jan 06, 2010 12:29 pm

i am getting the following error when i try to edit an entry...

Table Book not supported. File not found.

This is my Edit function

Code: Select all

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once( JApplicationHelper::getPath( 'admin_html' ) );
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
JTable::addIncludePath('path'.DS.'to'.DS.'tables');

switch($task)
{
	case 'add':
	editReview( $option );
		break;
}
function editReview( $option )
{
	$row =& JTable::getInstance('Book', 'Table');
HTML_reviews::editReview($row,$option);
}
?>

vdst
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Tue Jul 01, 2008 8:05 pm

Re: Table not supported. File not found.

Post by vdst » Sat Jan 16, 2010 2:25 am

Thanks coolbung.

Code: Select all

JTable::addIncludePath('path'.DS.'to'.DS.'tables');
..was all I was missing in the entry file.

Cheers, you always seem to have correct and concise posts.

Vdst.

Dha_wal
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Jan 01, 2010 4:28 pm

Re: Table not supported. File not found.

Post by Dha_wal » Mon Jan 18, 2010 12:19 pm

Thanks, my problem get solved by adding

Code: Select all

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
on the entry point of my component.
But the question is when i downloaded the com_hello component there is no such inclusion. So what is the need for adding the code here.
Let me make it more clear.
What am I asking is the MVC component tutorial does not include any such code on the page hello.php so why it is required to include in the component i am developing right now.
Thanks

robert101083
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Wed Oct 10, 2007 12:39 pm

Re: Table not supported. File not found.

Post by robert101083 » Thu Feb 04, 2010 6:56 am

Dha_wal wrote:Thanks, my problem get solved by adding

Code: Select all

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
on the entry point of my component.
But the question is when i downloaded the com_hello component there is no such inclusion. So what is the need for adding the code here.
Let me make it more clear.
What am I asking is the MVC component tutorial does not include any such code on the page hello.php so why it is required to include in the component i am developing right now.
Thanks
Hi Dha_wal,

I was thinking the same! If you look at the Hello-Component Tutorial there is no include at all.
Tutorial: http://docs.joomla.org/Developing_a_Mod ... t_-_Part_1

I think, when you use the include, you are not developing according the "Joomla! MVC Rules".

Did you find a solution without the include?

Cheers,
Robert

Dha_wal
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Jan 01, 2010 4:28 pm

Re: Table not supported. File not found.

Post by Dha_wal » Thu Feb 04, 2010 7:06 am

Robert, I have made some more components without using that include statement, it works great. Yet, don't know why it needed in that particular component.
-Dhawal

robert101083
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Wed Oct 10, 2007 12:39 pm

Re: Table not supported. File not found.

Post by robert101083 » Thu Feb 04, 2010 9:10 am

Dha_wal wrote:Robert, I have made some more components without using that include statement, it works great. Yet, don't know why it needed in that particular component.
-Dhawal
Hi Dhawal,

Thanks for your quick response. Unfortunately not the one I was hoping for. :O)

Does anybody else maybe have a solution/explanation for this?

Cheers,
Robert

teum
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 27, 2010 10:15 am

Re: Table not supported. File not found.

Post by teum » Fri Feb 05, 2010 10:03 am

Hi everybody,

I'm looking for the exact same answer too :)
Why does it work without the include in the tutorial and not in my component ? :eek:
And I'm not sure that the include is part of the good practices...

I used a debugger to find a solution but the only thing I know is that when the code tries to include de table class it looks for the good classname but in lowercase. And even if I change de name of my table class to lowercase it can't find it...

teum
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 27, 2010 10:15 am

Re: Table not supported. File not found.

Post by teum » Fri Feb 05, 2010 10:46 am

It goes like that :

JModel->getTable ($name = "myclassname", $prefix = "Table")
JModel->_createTable ($name = "myclassname", $prefix = "Table")
JTable->getInstance ($type = "myclassname", $prefix = "Table")
loader.php.class_exists ($class = "TableMyclassname")
loader.php.JLoader::load ($class = "TableMyclassname")
$class= strtolower($class);
class_exists($class = "tablemyclassname")

And the "tablemyclassname" class exists in com_component/tables/myclassname.php, but it isn't found...

I don't think that it will solve the problem but I'm going to try to rename "myclassname.php" to "tablemyclassname.php" just to see if it works (cause I'm desperate !).

teum
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 27, 2010 10:15 am

Re: Table not supported. File not found.

Post by teum » Fri Feb 05, 2010 11:00 am

And it doesn't... :-\

robert101083
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Wed Oct 10, 2007 12:39 pm

Re: Table not supported. File not found.

Post by robert101083 » Fri Feb 05, 2010 12:21 pm

I think you have to make sure you have got the right name your table class:

Filename: /tables/template.php
Class: class TableTemplate extends JTable {
Model: $model = $this->getModel('template');

This works for me now, without the include.

I think most bugs happen in J1.5 development because of naming inconsistency. Pretty hard to find :D

teum
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 27, 2010 10:15 am

Re: Table not supported. File not found.

Post by teum » Fri Feb 05, 2010 1:27 pm

I named everything as you say, but it still doesn't work.

You just didn't show me your call to getTable() in the model.

The only difference I can see with the tutorial is that I'm not working on a plugin for the admin but for the site...

teum
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 27, 2010 10:15 am

Re: Table not supported. File not found.

Post by teum » Fri Feb 05, 2010 4:53 pm

I just found the solution to my problem ! :laugh:

I was thinking, the only difference between my component and the one from the tutorial (http://docs.joomla.org/Developing_a_Mod ... g_a_Record) is that my component is for the frontend, not the backend.

And then I found, thanks to Ian (http://forum.joomla.org/viewtopic.php?p ... 1#p1805261) that the only thing to do in order for joomla to find the table without the

Code: Select all

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
is to move the "tables" directory into the admin directory of your component (even if your component doesn't have any backend part).

That's all !

Dha_wal
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Jan 01, 2010 4:28 pm

Re: Table not supported. File not found.

Post by Dha_wal » Sat Feb 06, 2010 6:54 am

Great teum
Thanks a lot for sharing this. :)

uokesita
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Feb 11, 2010 7:40 pm

Re: Table not supported. File not found.

Post by uokesita » Thu Feb 11, 2010 7:43 pm

hey this worked for me too. thanks teum
so the tables must go on the admin side....

xavip
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Mon Jan 19, 2009 5:33 pm

Re: Table not supported. File not found.

Post by xavip » Fri Apr 02, 2010 10:58 am

that's it, misterious but true!

Zarkor
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue May 18, 2010 9:02 am

Re: Table not supported. File not found.

Post by Zarkor » Fri Jun 04, 2010 9:05 am

move the "tables" directory into the admin directory of your component (even if your component doesn't have any backend part).

That's all !
i love u!

oussamac
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sat Jan 05, 2008 9:22 pm

Re: Table not supported. File not found.

Post by oussamac » Wed Aug 25, 2010 5:13 pm

teum wrote:I just found the solution to my problem ! :laugh:
.... is to move the "tables" directory into the admin directory of your component (even if your component doesn't have any backend part).

That's all !

OH thanks Teum a lot! You saved my time! :D
Your solution worked perfectly for me!

frank huang
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 25, 2010 4:21 am

Re: Table not supported. File not found.

Post by frank huang » Sat Sep 25, 2010 4:28 am

Dear all,

Could you give me more detail for the solution ?

I have below error after i installed SugarCase to Joomla 1.5

"Table SugarConfig not supported. File not found. "

i checked, my coding as below

JTable::addIncludePath( JPATH_COMPONENT . DS . 'tables' );
$row = & JTable::getInstance('SugarConfig', 'Table');

have addIncludePath, and Sugarcase components with folder "tables", it's used in Back office. any body give more detail for the problem ?

thanks

yitwail
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Jan 10, 2009 8:27 pm

Re: Table not supported. File not found.

Post by yitwail » Mon Nov 08, 2010 9:14 am

I can't answer Frank's question, but I have an observation to make. Maybe everyone else already knows this, but the table name has to match the name of the file in adminstrator/components/com_componentname/tables. So, if you have TableA and TableB, you need files tablea.php & tableb.php, and those files must contain

Code: Select all

class TableTableA extends JTable
and

Code: Select all

class TableTableB extends JTable
I was hoping I could put a bunch of different tables in one file, tables/table.php, but that doesn't work.

User avatar
lebill
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Jun 26, 2008 8:55 pm
Location: Prévost, Canada
Contact:

Re: Table not supported. File not found.

Post by lebill » Mon Aug 15, 2011 7:01 pm

Hi

I just get the same issue with the HelloWorld tutorial (I try com_helloworld-part15)

and found out it was missing this in the /models/helloworld.php

Code: Select all

public function getTable($name = '', $prefix = 'youTableNameTable', $options = array())
	{
		return parent::getTable($name, $prefix, $options);
	}
It was there in the previous tutorial but missing in that one (I didn't check if it was missing in other tutorial)

Bill


Locked

Return to “Extensions for Joomla! 1.5”