PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Internationalization » Translation2 » Bug #2953

getPage when using database container throws SQL syntax error

Details

Submitted2004-12-12 15:37 UTC
Frombaton at pop dot e-wro dot pl
Assignedquipo
StatusNo Feedback
PackageTranslation2
PHP Version4.3.9
OSwindows xp
Roadmaps(Not assigned)

Comments

[2004-12-12 15:37 UTC] baton at pop dot e-wro dot pl

Description:
------------
the implementation of getPage (in e.g. Container/db.php file) is such that the "SELECT" tries to select two columns - 'string_id_col' and 'lang_col' where the second one is not there (as language is a column not a row value in default structure). So in fact the $lang_col var declared two lines above is empty for default tables structure. In such case the sql looks something like "SELECT id, FROM i18n..." and the comma after id is obviously errorenous.

Reproduce code:
---------------
as patch i right now use:

empty($lang_col)?'id':$lang_col

instead of simple '$lang_col' for a second param to sprintf function creating sql query for getPage method in Container/db.php

[2004-12-14 19:31 UTC] baton at pop dot e-wro dot pl

it seems like the "$this->currentLang['id']" returns '' (is not defined) when i do not set the second parameter to the function getPage(), it i set it to any valid value it is ok

so going further when the $langID is null while retrieving $lang_col using _getLangCol we again get null, where geting $table we get 'i18n'

i use all default options for tables