Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




New Conflict with Relevanssi (1.3.44->1.3.50)

UserPost

10:57 am
December 5, 2011


metal450

Member

posts 178

1

Upon updating from 1.3.44 to 1.3.50, Role Scoper no longer behaves correctly with Relevanssi: in particular, search results no longer include any reader-limited articles (even when those articles *should* be returned by the search and are viewable by the currently logged-in user).

3:39 pm
December 19, 2011


Kevin

Admin

posts 2503

2

I've never worked with Relevanssi nor tested it, and at this point it looks incompatible with Role Scoper. I would need to schedule some consulting time to investigate / address this along with a more serious conflict I discovered.

9:43 pm
December 19, 2011


metal450

Member

posts 178

3

Which more serious conflict (just out of curiosity) - something relevant to this, or another issue reported by another user?

How much would you estimate it would cost me to get it back to the behavior of v1.44, in the current version…?

5:37 am
December 20, 2011


spreed

Member

posts 2

4

Hello,

I have a similar problem, even after reading Relevanssi support forum, where they say it's fixed…

After typing a word to search, all related contents are displayed, although if the user clicks on a link to read the complete text, log in is required if the user has no rights to read it.

Does it works with Role Scoper 1.3.44?


Thank yo very much!

7:40 am
December 20, 2011


Kevin

Admin

posts 2503

5

Relevanssi's indexing functionality undermines user-specific access filtering.

11:03 pm
December 20, 2011


metal450

Member

posts 178

6

@spreed: Yes, .44 is the last version in which it works as expected - I decided to try each version between .44 and .50, and found that .44->.45 is where it seems to break.  However, note that the behavior I'm seeing is NOT the same as you - you say that you can see ALL content (even if a user can't access it).  For me it's the opposite: it's not returning any of the content that the current user should be able to access.


@Kevin: Hasn't user-specific access filtering existed all along, though?  I've been using Relevanssi almost as long as Role-Scoper, and they've always worked wonderfully together - until the 1.3.44->1.3.45 changes…

1:16 pm
December 22, 2011


Kevin

Admin

posts 2503

7

I'm not seeing RS 1.3.44 as compatible either (same results as spreed indicated).

If either of you can provide directions on a Restriction / Role configuration that works on 1.3.44 but not subsequent? I also looked over the 1.3.44 to 1.3.45 changes and don't see anything that pertains.

1:41 pm
December 22, 2011


metal450

Member

posts 178

8

Here's a video that first shows a search by an anonymous user (for whom a restricted post is not visible), followed by the same search by a logged-in user (for whom the restricted post becomes visible).

I then login and show you the permissions set on that post, and scroll through each tab on Role-Scoper's options page.  Hopefully these are the relevant settings you need, but if not, please let me know and I'll snapshot the others.  Hopefully I scrolled slowly enough that you can pause the video to get a better look at the pages which may be relevant.

<Link Removed>

(Once you've seen/copied it, please remove the video link from this post :))

3:17 am
December 23, 2011


spreed

Member

posts 2

9

I'm sorry, but I have entered later and the video link is no longer available. Could you post it again, please?

Thank you!

8:09 am
January 20, 2012


metal450

Member

posts 178

10

@spreed: I don't see why you'd need to see a video of my backend permission settings…


@Kevin: Just curious if you happen to've had a chance to look at this?  I emailed you a link to the video, but never heard back so I'm not sure if you got it.  Tried the new v1.3.52 but the same problem persists.

Thanks! :)

2:08 pm
January 20, 2012


Kevin

Admin

posts 2503

11

Sorry, but no, I haven't pursued this further yet. It came at a rough time and just hasn't fit in well with other tasks.

I'm putting it on the radar for a re-evaluation next week.

7:43 pm
January 20, 2012


metal450

Member

posts 178

12

No worries, just checking up…thanks again! :)

2:24 pm
January 27, 2012


Kevin

Admin

posts 2503

13

Both of the symptoms mentioned above are fixed in RS 1.3.53. There were actually three different issues, listed in the change log.

9:03 pm
January 27, 2012


metal450

Member

posts 178

14

Hey Kevin,

Tried it out, and the Relevanssi conflict indeed seems to be fixed!  However, a new bug has been introduced :(


I'm now completely unable to post comments to private blog entries.  When logged in as Administrator and viewing a private post (that only I can see), if I try to post a comment it simply seems to be ignored - the page is refreshed and no comment is there (either when viewing the post itself or on the backend admin panel).  If, however, I then revert to 1.3.44 (the last version in which everything worked), the comments I posted with 1.3.53 suddenly become visible.

9:07 pm
January 27, 2012


metal450

Member

posts 178

15

…Whoa!! I just reverted to 1.3.44 and now Relevanssi isn't working *at all* - it even doesn't work when I disable Role-Scoper entirely!  Does simply installing (and subsequently removing) 1.3.53 make some permanent change??

9:14 pm
January 27, 2012


metal450

Member

posts 178

16

…It appears to've wiped out the Relvanssi index.  Re-indexing allowed it to work with 1.3.44 as it had before.  Strange :/

7:16 am
January 30, 2012


Kevin

Admin

posts 2503

17

metal450 said:

I'm now completely unable to post comments to private blog entries.


I'm not seeing this with WP 3.3.1 and RS 1.3.53. I also have Relevanssi running, but don't know what interactions may be occurring with your other plugin or theme code. If you'd like me to pursue it further, please experiment with switching theme and disabling plugins.

7:28 am
January 30, 2012


Kevin

Admin

posts 2503

18

metal450 said:

Does simply installing (and subsequently removing) 1.3.53 make some permanent change??


There may be a remaining conflict at play here. But but no, RS makes no change other than calling relevanssi_truncate_cache() and relevanssi_build_index()

I'm not seeing RS deactivation as a repeatable cause of Relevanssi index corruption. As you have noted, re-indexing via Settings > Relevanssi corrects the condition. Let me know if you find a more definite cause.

8:34 am
January 30, 2012


metal450

Member

posts 178

19

Regarding the dumped Relevanssi Index: it's pretty strange, but not a big deal - as long as functionality can be restored simply by rebuilding the index, enabling/disabling RS isn't something I'm really doing every day anyway :)

Regarding the comments issue: my sincere apologies again, this seems not to be your fault.  I've got a supplementary "safety filter" that I use to protect comments on hidden posts from appearing in the Recent Comments widget when Role-Scoper is DISABLED.  The code is as follows, but the issue seems to be that for some reason "class_exists('CommentsInterceptor_RS')" doesn't detect RS 1.3.53 as it does 1.3.44.  Thus it thinks RS is off and blocks all comments on private posts.  I'll play around with some other conditions, I s'pose :)


add_filter('query', 'safe_get_comments', 999 );

function safe_get_comments($query)

{

    //If Role-Scoper is already filtering comments for us, don't worry about this

    if( class_exists('CommentsInterceptor_RS') ) return $query;


    //If this isn't a comment query, don't worry about this

    if( !strpos($query, 'comment') )             return $query;


    //If query doesn't pertain to RELEVANT comments, skip out immediately.  The condition is from rolescoper's hardway-front_rs

    if ( strpos($query, "ELECT") && ! strpos($query, 'JOIN') && ! strpos($query, "COUNT") && strpos($query, "comment_approved") )

    {

        //The initial query is like #1, and we want #2:

        //#1) SELECT * FROM wp_comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 20

        //#2) SELECT * FROM wp_posts,wp_comments WHERE comment_approved = '1' AND comment_post_ID = ID AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 20

        $query = str_replace("FROM ", "FROM wp_posts,", $query);

        $query = str_replace("WHERE ", "WHERE comment_post_ID = ID AND post_status = 'publish' AND ", $query);

    }

    return $query;

}

8:46 am
January 30, 2012


metal450

Member

posts 178

20

…It's because of this, in role-scoper_main.php:


if ( $is_administrator ) {

if ( $this->is_front() )

require_once( 'comments-int-administrator_rs.php' );

} else

require_once( 'comments-interceptor_rs.php' );


(i.e. when logged in as an admin, it's now using a different comment interceptor class).  Changing it to check for class 'Scoper' instead works for both versions.


About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1247

Posts: 5656

Members:

There are 1259 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin