Bug #29783
closedgetQuery: fields explicilty added on select <table>.* : Error: ambigious parameter uid
Added by Björn Pedersen almost 13 years ago. Updated almost 7 years ago.
100%
Description
tslib_content->getQuery add ui and pid to the selected fields if fields are set. It does not check, wether a tablename.* occurs.
That occurs e.g. using cal_ts_service to link seminars events to cal calenders. There the query needs to contain table.title as mytitle.
Solution: Check, if a * is part of the requested fields.
Updated by Mr. Hudson almost 13 years ago
Patch set 1 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Mr. Hudson almost 13 years ago
Patch set 2 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Mr. Hudson almost 13 years ago
Patch set 3 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Tobias Liebig almost 13 years ago
- Category set to Database API (Doctrine DBAL)
- Status changed from New to Under Review
- Assignee set to Björn Pedersen
Updated by Björn Pedersen almost 13 years ago
The TS from cal_ts_service:
plugin.tx_cal_controller { display { seminars { # @description This is the heart of the connection SQL. It will be used in conjunction with # the view-where (findallWithinWhere, findAll and findWhere) to retrieve the according records. event_select { selectFields = tx_seminars_seminars.*, tx_seminars_timeslots.*, tx_seminars_timeslots.begin_date as bgndt, tx_seminars_timeslots.end_date as nddt, tx_seminars_seminars.title as mytitle, tx_seminars_timeslots.begin_date as my_startdate, tx_seminars_timeslots.end_date as my_enddate leftjoin = tx_seminars_timeslots ON (tx_seminars_seminars.uid=tx_seminars_timeslots.seminar) } }
Updated by Mr. Hudson almost 13 years ago
Patch set 4 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Helmut Hummel almost 13 years ago
- Status changed from Under Review to Accepted
- Priority changed from Should have to Must have
- Target version set to 4.6.0-RC1
This needs to be resolved in RC1 or #17284 must be reverted.
Updated by Mr. Hudson almost 13 years ago
Patch set 5 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Christof Rodejohann almost 13 years ago
While fixing this issue please take into account problems arising from http://forge.typo3.org/issues/30486
Especially uid, pid and t3ver_state should never be used without especially defining the table. This is because when using a join you will always have uid, pid and t3ver in both tables. Therefore resulting in a "Error: ambigious parameter uid".
Furthermore we should take some time to think about how workspace's should be handled for the second part of the join.
Updated by Steffen Gebert almost 13 years ago
- Status changed from Accepted to Under Review
Updated by Björn Pedersen almost 13 years ago
@Christof Rodejohann:
That#s what this patch is about.
Updated by Mr. Hudson almost 13 years ago
Patch set 6 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Mr. Hudson almost 13 years ago
Patch set 7 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Christof Rodejohann almost 13 years ago
@Björn Pedersen
Kind of. The latest patch still fails on a basic join. I am quoting my test setup from http://forge.typo3.org/issues/30486
page = PAGE page.10 = COA page.10 { 10 = CONTENT 10 { table = tt_content select { selectFields = tt_content.header,be_users.username join = be_users ON tt_content.cruser_id = be_users.uid } renderObj = COA renderObj { 10 = TEXT 10.field = header 20 = TEXT 20.field = username } } }
This setup fails with the latest patch and error "Column 'uid' in field list is ambiguous".
That is because you add the raw uid,pid and t3ver_state without the explicit database table name. You focus on the selectFields and table part. But the join setup adds another table and contains a different set of uid,pid and t3ver_state.
Adding the table name to uid,pid and t3ver_state from $table and aliasing them back to uid,pid and t3ver_state would be an easy fix. But how should workspace's be handled for the second part of the join?
Updated by Björn Pedersen almost 13 years ago
@Christof:
The workspace part for the join probably is one of the border cases that I can not fix at the moment. In such a case it is still the responibility of the TS writer to ensure all the right fields are selected.
Updated by Christof Rodejohann almost 13 years ago
@Björn:
IMHO this is fine. I am trying to push a patch for the $table part, so you won't have to do all the work. But i am having a lot of trouble with gerrit.
Updated by Mr. Hudson almost 13 years ago
Patch set 8 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Christof Rodejohann almost 13 years ago
@Björn:
Patch set 8 resolves the join issue from http://forge.typo3.org/issues/30486. I believe this bug is resolved. Good work.
Updated by Mr. Hudson almost 13 years ago
Patch set 9 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Mr. Hudson almost 13 years ago
Patch set 10 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Mr. Hudson almost 13 years ago
Patch set 11 of change I50332c22e627ea452aaee233fdbbdf3dd426a1b6 has been pushed to the review server.
It is available at http://review.typo3.org/4974
Updated by Björn Pedersen almost 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1afc0014c4be2334e35bba6bdaa2d976237b472a.
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed