?
Referenced as Pull Request for: # 9009
avatar joomdonation
joomdonation
7 May 2015

We have several code like this in JTable

if (property_exists($this, 'checked_out') || property_exists($this, 'checked_out_time'))
{
    $query->where('(' . $this->getColumnAlias('checked_out') . ' = 0 OR ' . $this->getColumnAlias('checked_out') . ' = ' . (int) $userId . ')');
    $checkin = true;
}

Here is one example https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/table/table.php#L1568-L1572

As you see, we allow developers to set column alias for a column in case they want to use different field name than the one using by Joomla. However, the problem is that in in the check in if command, we hardcode the field name to checked_out and checked_out_time, not using getColumnAlias. So if someone uses column alias, the code won't run properly.

Should we update the code to make it consistent and correct it in case someone uses column alias?

avatar joomdonation joomdonation - open - 7 May 2015
avatar brianteeman brianteeman - change - 7 May 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 7 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 7 May 2015
Category Libraries
avatar julienV
julienV - comment - 9 May 2015

it would make sense indeed !


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6901.

avatar brianteeman
brianteeman - comment - 28 Jan 2016

Are you going to submit a Pull Request for this


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6901.

avatar brianteeman brianteeman - change - 28 Jan 2016
Status New Information Required
avatar joomdonation
joomdonation - comment - 28 Jan 2016

Hi Brian

Yes. I will find sometime to do it on tomorrow.

avatar joomdonation
joomdonation - comment - 28 Jan 2016

OK. I created the PR. Please help closing this issue, Brian

avatar brianteeman brianteeman - change - 28 Jan 2016
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2016-01-28 14:28:51
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 28 Jan 2016

Closed as we have a PR #9009 Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6901.

avatar brianteeman brianteeman - close - 28 Jan 2016

Add a Comment

Login with GitHub to post a comment