In notifications_get_notifications there is a query built
which joins notifications and notifications_fields tables.
The query builder is flexible enough to work with multiple
conditions in the WHERE clause using columns from both
tables. There is code that attempts to use the proper
Drupal db column placeholders for strings or integers
via this code:
is_numeric($value) ? $name .' = %d' : "$name = '%s'";
The problem that occurs in PostgreSQL (8.3+) involves
cases where the 'value' column from notifications_fields
table ends up with an actual $value in the WHERE clause
that is an integer. This is a problem because the 'value'
column in notifications_fields is a VARCHAR and PostgreSQL
will no longer automatically type cast the integer to
a CHAR. In the example above you might end up a case
where the value of 'field' in notifications_fields is 'author'
and the value of 'value' in notifications_fields is '25'. The
above code will see '25' as an integer and so pass the
'%d' integer placeholder to Drupal which will result in
the VARCHAR column = INTEGER value problem.
My patch is a pretty kludgy workaround but it does fix the
problem. Will commit the change but keep this issue active
for reference sake.
| Comment | File | Size | Author |
|---|---|---|---|
| notifications.module.patch | 784 bytes | jaydub |
Comments
Comment #1
jaydub commentedComment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.