Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
User content subscription views handling does not work at all.
Comment | File | Size | Author |
---|---|---|---|
#3 | notifications-1866864-3-views-cleanup.patch | 4.41 KB | czigor |
#1 | notifications-1866864-1-views-cleanup.patch | 4.43 KB | czigor |
Comments
Comment #1
czigor CreditAttribution: czigor commentedUser content views integration cleaned up a bit.
Comment #2
czigor CreditAttribution: czigor commentedComment #3
czigor CreditAttribution: czigor commentedTypo fix in one of the array keys.
Comment #4
Rob230 CreditAttribution: Rob230 commentedCan you clarify what you fixed in this patch?
I don't know whether a separate issue is needed for this, but I have found the Views integration to be very sketchy.
For example, when trying to create a block View that shows users subscribed to current node. First of all I tried it in the logical way:
This fails immediately on the relationship with the following SQL error:
The query:
Note the error: it has
users.
for the join condition. This is because in notifications_views.views.inc it is specified as:Views requires
'left_field'
to be specified for a join. Furthermore, there is no such field as notifications_subscription_fields.usid. I don't think it's possible to join to this table on uid, only to notifications_subscription, which contains the field uid.The second problem I discovered when trying to approach it in a different way. I created a View like this:
This fails on the sort criteria:
Indeed, there is no such field. The correct field name is
notifications_subscription.updated
. This is easily fixed in notifications_views.views.inc by changing this line:$data['notifications_subscription']['changed'] = array(
I wonder how many other things like this slipped through and haven't been noticed since 2011. Also, is this module abandoned?
Comment #5
czigor CreditAttribution: czigor commentedIn our site users can subscribe other users. I used this patch for to purposes:
#1: to display the users a given user is following.
#2: to display the users who follow a given user.
For example the view for #1 goes:
- User type view
- contextual filter: user uid
- 2 relationships: 1. user subscriptions 2. (subscriptions) Notifications Fields: Author
- 1 field: (Author) User: Rendered User
I think the patch in https://drupal.org/node/1268970#comment-6831516 is also needed.
My patch does not fix the whole views integration at all, just the bit I needed, that's why you see those SQLSTATE errors.
According to the project page the module is not abandoned, only seeking a new maintainer.