I have some problem with Productbook, it is a component for catalog.
$database->setQuery( "SELECT *, a.id , "
. " a.catid, "
. " a.imgtitle, "
. " a.imgauthor, "
. " a.imgtext, "
. " a.imgdate, "
. " a.imgcounter, "
. " a.imgvotes, "
. " a.imgvotesum, "
. " a.published, "
. " a.imgoriginalname, "
. " a.imgfilename, "
. " a.imgthumbname, "
. " a.owner, u.id "
. " FROM #__productbook as a "
. " \n left join #__users as u on u.username = a.owner "
. " \n WHERE a.id= '$id' "
. " AND a.approved=1 ");
This query is not correct for joomfish, this return only italian and not english or espagnol.
I change "a.id" with "a.id as id" and "u.id" with u.id as id" , id is primary key of #__productbook table and #__users also.
I read this on Developer Documentation - Compatible Query Construction
In this example the primary key is "id" for both #__table1 and #__table2.
Incorrect : "SELECT t1.*, t2.* FROM #__table1 AS t1 LEFT JOIN #__table2 AS t2 ON t1.id=t2.fkey"
Correct : "SELECT t1.id AS key, t1.*, t2.id AS key2, t2* FROM #__table1 AS t1 LEFT JOIN #__table2 AS t2 ON t1.id=t2.fkey"
But return only italian!
Some idea?
Thanks Davide
