2021-09-13 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in 'RDCartFilter' that caused a SQL error to be
	thrown during initialization.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-09-13 13:23:55 -04:00
parent 7bd18d2ea5
commit b6f343df9b
2 changed files with 6 additions and 5 deletions

View File

@ -22421,3 +22421,6 @@
* Fixed a regression in rdlibrary(1) that could cause less than
100 carts to be displayed when the 'Show Only First 100 Matches'
box was ticked.
2021-09-13 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in 'RDCartFilter' that caused a SQL error to be
thrown during initialization.

View File

@ -222,17 +222,15 @@ QString RDCartFilter::filterSql(const QStringList &and_fields) const
// Group Filter
//
QStringList groups;
for(int i=0;i<d_group_box->count();i++) {
if(d_group_box->itemText(i)!=tr("ALL")) {
groups.push_back(d_group_box->itemText(i));
}
for(int i=1;i<d_group_box->count();i++) {
groups.push_back(d_group_box->itemText(i));
}
if(groups.size()==0) { // No groups selected, so force an empty selection
return QString(" where `CART`.`NUMBER`<0"); // An impossibility
}
sql+=RDCartFilter::groupFilter(d_group_box->currentText(),groups);
if(d_show_track_carts) {
sql=sql.left(sql.length()-2); // Remove the final "&&"
sql=sql.left(sql.length()-3); // Remove the final "&& "
}
else {
sql+="`CART`.`OWNER` is null ";