2.5.17 Error in a SQL form Field type

The support for Joomla 2.5 ended on December 31, 2014. Possible bugs in Joomla 2.5 will not be patched anymore. This forum has been closed. Please update your website to Joomla 3.x

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
ugokind
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed May 13, 2009 9:36 am

2.5.17 Error in a SQL form Field type

Postby ugokind » Sun Jan 19, 2014 8:20 pm

According to
http://docs.joomla.org/SQL_form_field_type

if I write this field:

Code: Select all

query="SELECT
#__jshopping_categories.category_id ,
#__jshopping_categories.name_it-IT
FROM #__jshopping_categories"


the Form returns an error:
Unknown column 'dvr_jshopping_categories.name_it' in 'field list' SQL=SELECT dvr_jshopping_categories.category_id , dvr_jshopping_categories.name_it-IT FROM dvr_jshopping_categories

as you can see in Bold.. Joomla is not parsing correctly the field in the query
if the name of the field is xxxxxx_xxx-xx

I tested a lot of fields.. normally in a database and in joomla a filed is named with
_name_name

but if the field contains
-
the sign '-' and the following texts are truncated!

So I want to solve by miself but.. I cannot find the place where the function elaborates this!

can you help me?

thanks in advance..
Ugo

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8603
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: 2.5.17 Error in a SQL form Field type

Postby toivo » Mon Jan 20, 2014 8:31 am

This behaviour originates directly from MySQL, not Joomla.

Even though MySQL Workbench allows you to create a field name containing a dash, which looks like a bug, a query using the same field name returns an error, as you show:

Code: Select all

Error Code: 1054. Unknown column
followed by the truncated column name.

This happens by design. A dash should not be used in field names because it is an arithmetic operator and it does not require space characters to separate it from the two operands.

http://dev.mysql.com/doc/refman/5.5/en/identifiers.html

http://dev.mysql.com/doc/refman/5.5/en/ ... tions.html
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

ugokind
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed May 13, 2009 9:36 am

Re: 2.5.17 Error in a SQL form Field type

Postby ugokind » Mon Jan 20, 2014 7:54 pm

oh great!
thanks toivo!

but.. this is the typical problem of a localization coloumn of a multi language portal.. gosh!

mine is from JoomShopping.
I don't want to insist.. but I suppose the joomshopping categories table (which uses 6 coloumn for every locale) works fine.. and if it works fine.. I suppose the problem is outside it.
I mean: If joomshopping oeprates normally with those tables.. why the XML form population from the sql statement not?

thanks for all.. you're great!!

ugo


Return to “Joomla! 2.5 Bug Reporting”

Who is online

Users browsing this forum: No registered users and 2 guests