Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Database error

Database error 04 Jun 2013 18:34 #7325

  • JurgenG
  • JurgenG's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Hello,

I tried creating an extension, but in the sandbox, I got the following error:

500 SQL=SELECT a.id, a.title, a.checked_out, a.checked_out_time, a.created, a.hits,l.title AS language_title,uc.name AS editor,ag.title AS access_level,c.title AS category_title,ua.name AS author_name FROM xh3ui_content AS a LEFT JOIN `xh3ui_languages` AS l ON l.lang_code = a.language LEFT JOIN xh3ui_users AS uc ON uc.id=a.checked_out LEFT JOIN xh3ui_viewlevels AS ag ON ag.id = a.access LEFT JOIN xh3ui_categories AS c ON c.id = a.catid LEFT JOIN xh3ui_users AS ua ON ua.id = a.created_by ORDER BY a.hits DESC LIMIT 0, 5

This error appears in Joomla 1.6 and in Joomla 3.0 settings (didn't try the other versions yet)
The error also occurs in the downloaded extension.

If you wish, I will gladly supply you with the component in question.
The administrator has disabled public write access.

Re: Database error 04 Jun 2013 18:38 #7326

  • JurgenG
  • JurgenG's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Extra addition: when installing the downloaded extension, it doesn't work on a live site either... when uninstalling the extension, it effectively breaks the database (at least in a Joomla 3 setting).

I assume this is a risk of using beta software. (luckily I only used it on a beta site)

Grtz,
Jurgen
The administrator has disabled public write access.

Re: Database error 04 Jun 2013 18:45 #7327

  • JurgenG
  • JurgenG's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
I figured out the issue myself: it is possible to use names of already existing tables.
I created a table "languages" - it failed in creating it (as it already existed) thus it threw an error when trying to use it.

On uninstalling, it removes the core table and breaks the site.

Suggestion: Add a component prefix to the tables - so for com_mycomponent, the tables would become:
#_mycomponent_languages
#_mycomponent_members

(actually, I faultly assumed this)

This prevents the component of breaking tables for the core joomla or other extensions.
The administrator has disabled public write access.

Re: Database error 05 Jun 2013 09:09 #7337

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Wich component is causing the error ?

Maybe something wrong with the checked out feature...

The SQL string error is indirectly coming to your component wich is asking something to Joomla.

What are the names of the database tables of your downloaded component ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Database error 05 Jun 2013 13:55 #7345

  • JurgenG
  • JurgenG's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Hi,

the component I'm working on is called Mailbridge.

The tables are: "languages" and "members"
Effectively the "languages" table iinterferes with the core tables from Joomla.

Renaming this table fixed the issue. (it can break a system though)

PS. The error also occurs in the old version, so isn't inherent to the beta.
Last Edit: 05 Jun 2013 13:57 by JurgenG.
The administrator has disabled public write access.

Re: Database error 05 Jun 2013 14:07 #7347

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Ok, will check it soon.
Coding is now a piece of cake
Last Edit: 05 Jun 2013 14:12 by admin.
The administrator has disabled public write access.

Re: Database error 05 Jun 2013 14:29 #7349

  • JurgenG
  • JurgenG's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
Don't know if I should submit this as a new bug, or just report it here (as it arose during the same process)

When renaming the table "languages" to "MM_languages", it would be nice if all occurances of the old "languages" would also be renamed. I manually changed the "foreign table" link (removed it and put a new one).

Strange enough, in the PAGES view, the old reference still appears in the left column - can't seem to update that link. Obviously, the compilation fails as it can't find the languages table
The administrator has disabled public write access.

Re: Database error 09 Jun 2013 20:23 #7402

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Should be fixed. (v2.5.1)
www.j-cook.net/index.php/docs/versions/75-2-5-1

Please try again.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.071 seconds

Get Started