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?
Labels |
Added:
?
|
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Are you going to submit a Pull Request for this
Status | New | ⇒ | Information Required |
Hi Brian
Yes. I will find sometime to do it on tomorrow.
OK. I created the PR. Please help closing this issue, Brian
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-01-28 14:28:51 |
Closed_By | ⇒ | brianteeman |
Closed as we have a PR #9009 Thanks
it would make sense indeed !
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6901.