edit tabledata fail

Edit tabledata fail, a forum discussion on Jojo CMS. Join us for more discussions on Edit tabledata fail on our Administration (backend and configuration) forum.

Back to Forum Index : Back to Administration (backend and configuration)   RSS
raulandres

30 Jun 2009
Posts: 35

hello again... ;) i try create new tabledata, its created well, but when i click on any link edit fielddata, edit form, on same submen of edit tabledata above its fail, it show me a error with a lot of SQL SELECTs on screen.

I fix it running http://domain/setup but when try create tabledata again appear same error, why?

thx!
tom

Developer

tom

30 Jun 2009
Posts: 379

Can you post an example of the SQL error you're getting?

It's probably an error in the setup files for one of the plugins not correctly assigning a keyfield.
raulandres

1 Jul 2009
Posts: 35

its more long but i cut a little, thx

SELECT empresasid AS id, name, city AS display, '0' AS parent, '0' AS rollover FROM `` WHERE 1 Incorrect table name ''array(5) { [0]=> array(6) { ["file"]=> string(88) "/home/.atomic/dev_collad/dev.collad.com/jojocms/plugins/jojo_core/classes/Jojo/Table.php" ["line"]=> int(499) ["function"]=> string(11) "selectQuery" ["class"]=> string(4) "Jojo" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> &string(119) "SELECT empresasid AS id, name, city AS display, '0' AS parent, '0' AS rollover FROM {} WHERE 1 " } } [1]=> array(7) { ["file"]=> string(80) "/home/.atomic/dev_collad/dev.collad.com/jojocms/plugins/jojo_core/admin_edit.php" ["line"]=> int(193) ["function"]=> string(10) "createlist" ["class"]=> string(10) "Jojo_Table" ["type"]=> string(2) "->" ["object"]=> object(Jojo_Table)
tom

Developer

tom

1 Jul 2009
Posts: 379

"Incorrect table name"
can you post the first section of the autoupdate file for the empresas table, the bit where it defines the tabledata (like this one for the articles table):

$default_td['article'] = array(
'td_name' => "article",
'td_primarykey' => "articleid",
'td_displayfield' => "ar_title",
'td_categorytable' => "articlecategory",
'td_categoryfield' => "ar_category",
'td_rolloverfield' => "ar_date",
'td_filter' => "yes",
'td_orderbyfields' => "ar_date DESC, articleid DESC",
'td_topsubmit' => "yes",
'td_deleteoption' => "yes",
'td_menutype' => "ajaxtree",
'td_help' => "News Articles are managed from here. ",
'td_golivefield' => "ar_livedate",
'td_expiryfield' => "ar_expirydate",
);

i suspect the
'td_name' => "empresas",
line is set incorrectly

If you haven't used an autoupdate file, you can fix it directly in configuration > edit tabledata
raulandres

1 Jul 2009
Posts: 35

hello tom, im looking around but i dont understand about autoupdate file, what is it?
only i can see autoupdate check on legacy options when i try create a new tabledata, but its Yes on default.
tom

Developer

tom

1 Jul 2009
Posts: 379

this is a custom plugin you built yourself?
It should have an 'install' folder in the plugin with (usually) at least two files - one called 'install_[pluginname].php' which creates the database table(s)
and one called 'autoupdate_[pluginname].inc.php' which tells Jojo how to display and handle the fields in the admin area.

If you don't have an autoupdate file, Jojo just guesses which fields are for what - often it does surprisingly well, but not always - and you'll need to edit Configuration> Edit Tabledata and Edit FieldData to tell Jojo what field types correspond to each field in the database.

Have a look at an existing plugin like gallery3 or articles, and how their install/autoupdate files relate to what's in the database and in Tabledata and FieldData, to see what I mean.
raulandres

2 Jul 2009
Posts: 35

no custom plugin, only i try create a new tabledata from admin, how to?

ok thx i looking arount gallery3 and articles plugin to learn plugin engine.
tom

Developer

tom

2 Jul 2009
Posts: 379

if you add a new table Jojo, needs to be told how to handle it. The most comprehensive way of dealing with it is to build a plugin,
but .. to do it manually:
You'll need to run setup for Jojo to find that a new table has been added to the database
then set it up in tabledata and fielddata and make an admin/edit/tablename page that calls the Admin Edit plugin.

in edit tabledata, Jojo assumes that the primary key field is [tablename]id. If it's different, you need to tell it what the primary key field is. It may not look pretty, but that's all you should need to get it working.
Back to Forum Index : Back to Administration (backend and configuration)   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.