Ticket #849 (closed defect: fixed)
Doctrine_Hydrator error while populate records if tablename's first character is underscore
| Reported by: | purnama | Owned by: | zYne- |
|---|---|---|---|
| Priority: | major | Milestone: | 0.10.4 |
| Component: | Query/Hydration | Version: | 0.10.0 |
| Severity: | Keywords: | underscore | |
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
I used '_portal_' prefix for my MySQL tables, and have Error while fetch records from tables.
this is the Doctrine_Query string :
SELECT _.gid AS ___gid, _.name AS ___name, _.email AS ___email, _.comment AS ___comment, _.tstamp AS ___tstamp, _.status AS ___status FROM _portal_guestbook _ WHERE _.status = 1
below the snapshot from the exception:
Call to a member function getFieldName() on a non-object in /var/www/portal/lib/doctrine/Doctrine/Hydrator.php on line 293 call stack: ... 7 0.2288 12997676 Doctrine_Hydrator->hydrateResultSet( ) ../Abstract.php:953 8 0.2319 13185000 Doctrine_Hydrator->_gatherRowData( ) ../Hydrator.php:119
in my search,the error starting in Doctrine_Hydrator line 287 :
$e = explode('__', $key);
while tablename's first character is underscore '_' and Doctrine_Query use it as table alias; it makes ambiguation. i try to use table alias $record->getTable()->createQuery('p'); but not work.
Change History
Note: See
TracTickets for help on using
tickets.