OG Notifications management form query fails in Postgresql

Created on 20 May 2010, over 14 years ago
Updated 27 October 2024, 19 days ago

Query in og_notifications_manage_form() fails like so:

Error:

accent=> SELECT n.nid AS group_nid, n.title, nof2.value AS node_type, no.*
accent-> FROM notifications no
accent->   INNER JOIN notifications_fields nof1 ON no.sid = nof1.sid
accent->   INNER JOIN notifications_fields nof2 ON no.sid = nof2.sid
accent->   INNER JOIN node n ON nof1.value = n.nid
accent-> WHERE no.uid = 23 AND (no.type = 'grouptype') AND no.conditions = 2 AND nof1.field = 'group' AND nof2.field = 'type' AND n.status = 1;
ERROR:  operator does not exist: character varying = integer
LINE 5:   INNER JOIN node n ON nof1.value = n.nid
                                          ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts

The line:

INNER JOIN {node} n ON nof1.value = n.nid

Should be changed to:

INNER JOIN {node} n ON nof1.value = (SELECT CAST(nid AS char) FROM node WHERE CAST(nid AS VARCHAR) = nof1.value)

Patch attached.

🐛 Bug report
Status

Closed: outdated

Version

2.1

Component

og_notifications

Created by

🇦🇺Australia halcyonCorsair

Live updates comments and jobs are added and updated live.
  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

  • 🇷🇴Romania claudiu.cristea Arad 🇷🇴

    This version of Drupal is not supported anymore. If this is still an issue in the 8.x-1.x branch, please open a new up-to-date ticket. Closing.

Production build 0.71.5 2024