column names in #__content and #__categories

69 views
Skip to first unread message

hoochicken

unread,
Aug 29, 2012, 11:57:41 AM8/29/12
to joomla-...@googlegroups.com
Hi,
I'm not sure, if I'm right here.
Lately (while working on a module) I found, that the tabels of #__content and #__categories (and other components, had a short look) have similar columns, yet named differently.
E.g.
#__content.state ~ #__categories.published
#__content.created ~ #__categories.created_time
#__content.created_by ~ #__categories.created_user_id
Is there a reason, why the columns are named differently? To me it seems, that the names should be the same.
Kind regards
Mareike

Rouven Weßling

unread,
Aug 29, 2012, 12:03:02 PM8/29/12
to joomla-...@googlegroups.com

On 29.08.2012, at 17:57, hoochicken <mareike...@ql.de> wrote:

Is there a reason, why the columns are named differently? To me it seems, that the names should be the same. 

They should. But it's a backwards compatibility issue to change them at this time.

Best regards
Rouven

elin

unread,
Aug 29, 2012, 4:38:06 PM8/29/12
to joomla-...@googlegroups.com
Those tables are pretty much the same tables as we had in 2005.

There are tons of modules, plugins and components that make queries against those tables so much as we might wish to make the field names the same  the breakage potential is huge. There will certainly be a point when that all changes when we switch the content model, but there is no point in making the changes until there is substantial benefit.

Elin

hoochicken

unread,
Aug 30, 2012, 2:02:59 AM8/30/12
to joomla-...@googlegroups.com
Thanks for the explanations!
When planning a new component, do you recommand a certain standard?
Would it be better to use 'state' or 'published' in a new component?
(Now it may be of no real use.
But later on it might be useful to have components with a fix group of some kind of standardized/recommended column names (and the additional columns typical for a special component).)
Kind regards
Mareike

elin

unread,
Aug 30, 2012, 2:15:20 AM8/30/12
to joomla-...@googlegroups.com
If you use state you can extend JTableContent more easily. That's especially useful if you are going to track assets.   The main fields with varying names are 
state/published
title/name
link/url
params/attribs
and then a bunch of the publication information. The only thing I would say about that is categories is different than all the others but it matches what is in the ucm repository.

Elin
Reply all
Reply to author
Forward
0 new messages