Bug #5150
closedCBSubs History log search fails due to join not adding to query
100%
Description
When searching the history log it's trying to filter on user_name, but it has no join data associated with it.
Unknown column 'I.user_name' in 'where clause' SQL=SELECT COUNT(*) FROM `jos_cbsubs_history` AS a WHERE ( ( I.`user_name` LIKE '%admin%' ) OR ( I.`user_full_name` LIKE '%admin%' ) OR ( a.`old_value` LIKE '%admin%' ) OR ( a.`new_value` LIKE '%admin%' ) OR ( a.`ip_addresses` LIKE '%admin%' ) )
https://www.joomlapolis.com/forum/277-cbsubs-gpl-support/228546-history-log-error
The table as is working fine, but the join is never added because the filter has no data. It should check for a join by filter name if no data is supplied encase a join does need to be added.
Updated by krileon about 10 years ago
Seams processJoinsNeededForCount usage in quicksearch parsing isn't picking this case up.
Updated by krileon about 10 years ago
Ok, this seams to be an ongoing issue of sub queries in the fieldsArray and being used as the tableAs check.
'user_name' => string 'IF( ( a.`user_id` = 0 ), 'System', b.`username` ) AS `user_name`' (length=64)
That's causing it to use "I" as the tableAs.
Updated by krileon about 10 years ago
This seams to be another case of the XML usage not making sense. It shouldn't be user_name as that's targeting an IF select usage; it has no join. It should just be "username". Next "user_full_name" should just be "name".
Updated by krileon about 10 years ago
- Status changed from Assigned to Rejected
- Target version deleted (
CB 2.0.8) - % Done changed from 0 to 100
This should be fixed in CBSubs.