Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




set_current_user problem

UserPost

2:43 pm
July 4, 2008


rainemaida

New Member

posts 1

1

I installed the role-scoper plugin and I have also got the calendar plugin and I get this error message.


Role Scoper cannot operate because another plugin or theme has already declared the function “set_current_user” or “wp_set_current_user”. All posts, pages and links are currently hidden.
Please remove the offending plugin, or deactivate Role Scoper to revert to blog-wide Wordpress roles.


I can't find either of those functions in the calendar plugin which is located here:


http://wordpress.org/extend/plugins/events-calendar/


I know it's the calendar plugin because when I deactived them one by one it was the only one that enabled role-scoper to work. I was wondering if someone could tell me the problem and how to fix it.


Cheers,

Steve

3:54 pm
July 5, 2008


Kevin

Admin

posts 2503

2

The offending code is in plugins/event-calendar/ec_js.class.php:


require_once(ABSPATH . 'wp-includes/pluggable.php');

This is executed very early in the session and prevents any other plugin from defining any pluggable function. I'm can't think of why this call would be necessary at all, but you can fix the Role Scoper conflict by moving that line of code to inside the class constuctor function like this:


function EC_JS() {
         require_once(ABSPATH . 'wp-includes/pluggable.php');
         $this->db = new EC_DB();
}

3:39 pm
August 1, 2008


maidanet

Member

Colorado Springs, CO

posts 15

3

Thanks for that fix - it works great for me.

I'm in contact with someone working on the Event Calendar plug in and I'll ask him to include this change in the next build.

4:08 pm
March 26, 2009


maraya

Member

maraya

posts 8

4

First — I appreciate this plugin even more now that I've tried to find another one to replace it!  I've been having the same problem as maidanet, here, and I'm glad to see there's a fix.

The conflict is happening with the Dr Register plugin, resulting in the set_current_user error.

http://wordpress.org/extend/plugins/dregister/

I looked in the dregister code and saw the offending line, and changed it as described here.  However, when I activated Dregister after making that change, I got this error:

Fatal error: Call to undefined function get_currentuserinfo() in /home/interp2/public_html/sections/IM/IMtest/wp-content/plugins/dregister/dregister.php on line 96

I realize it would be more appropriate to post this question on the Dregister site — and I have! — but I'm hoping it's something really simple and that someone here can point me in the right direction.

Thanks!

10:09 pm
March 26, 2009


Kevin

Admin

posts 2503

5

The DRegister issue is deeper than Events Calendar, in that DRegister is calling get_currentuserinfo() in its bootstrap function. I haven't looked into why that's done, but the conflict with Role Scoper is not likely to be resolved unless the get_currentuserinfo() can be moved into a hook-initiated function or perhaps replaced with a set_current_user handler.

10:38 pm
March 26, 2009


maraya

Member

maraya

posts 8

6

Yikes.  I have no idea what all that means, so I guess that means I have to give up on DRegister.  Bums!  I wish there was a profile-page customizer plugin as useful and flexible as Role Scoper.

Thanks for looking into this for me.Smile

9:21 am
March 27, 2009


Kevin

Admin

posts 2503

7

It may (or may not) be possible for DRegister to do its job without the bootstrap inclusion of pluggable.php and get_currentuserinfo() call. I just haven't looked into that code in depth. I think you should talk it over with the DRegister author (Ezio Lanza - Juzaam). I would be happy to confer with him if any potential and interest is there.

9:14 pm
March 27, 2009


maraya

Member

maraya

posts 8

8

Thanks Kevin.  I did so, and he seems interested, so hopefully he'll contact you.

In the meantime — in case anyone else is struggling to find a good profile customizing plugin that works with Role Scoper — I would recommend Cimy User Extra Fields.  The new release, v1.4, is way more flexible than Dregister, and doesn't delete your data when you need rearrange the fields.  I actually installed this plugin a while ago, but gave up after clicking around since the various field tags didn't make any sense to me.  But I tried it again, and now I believe it's the best custom profile plugin out there.  Clunky user interface, for sure, and little in the way of option descriptions, but once you figure it out, it does the job.  (Only caveat is that the developer is grumpy and yells at people for posting questions.)

http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/


About the Agapetry forum

Currently Online:

13 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1249

Posts: 5659

Members:

There are 1261 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