Skip to content

Commit

Permalink
Oracle: ORA-00904: "EMAIL": invalid identifier (sympa-community#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedas committed Oct 10, 2020
1 parent 0fa5376 commit d8b053d
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/lib/Sympa/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2706,19 +2706,16 @@ sub get_first_list_member {
($selection || '');

## SORT BY
if ($sortby eq 'email') {
## Default SORT
$statement .= ' ORDER BY email';

} elsif ($sortby eq 'date') {
$statement .= ' ORDER BY date DESC';

} elsif ($sortby eq 'sources') {
$statement .= " ORDER BY subscribed DESC,id";

} elsif ($sortby eq 'name') {
$statement .= ' ORDER BY gecos';
}
$statement .= ' ORDER BY '
. (
{ email => 'user_subscriber',
date => 'date_epoch_subscriber DESC',
sources =>
'subscribed_subscriber DESC, inclusion_label_subscriber ASC',
name => 'comment_subscriber',
}->{$sortby}
|| 'user_subscriber'
);
push @sth_stack, $sth;

unless ($sdm and $sth = $sdm->do_query($statement)) {
Expand Down Expand Up @@ -3259,12 +3256,13 @@ sub get_members {
if ($order) {
$order_by = 'ORDER BY '
. (
{ email => 'email',
date => 'date DESC',
sources => 'subscribed DESC, inclusion_label ASC',
name => 'gecos',
{ email => 'user_subscriber',
date => 'date_epoch_subscriber DESC',
sources =>
'subscribed_subscriber DESC, inclusion_label_subscriber ASC',
name => 'comment_subscriber',
}->{$order}
|| 'email'
|| 'user_subscriber'
);
}

Expand Down

0 comments on commit d8b053d

Please sign in to comment.