Entries List for Registered Users
Posted: 06 October 2010 12:14 PM   [ Ignore ]
Has a Nice Profile
RankRank
Total Posts:  126
Joined  2010-06-18

Hey Guys,

I’m having a strange issue, that I hope is just me being dumb. smile

We’re using SafeCracker for a job listings channel, and in the members’ profile page, they’ll be able to see their job postings. And for the most part, it works well, but I noticed that if I logged in as one user (in a certain “user” member group), posted a job, logged out and then logged in as another user (say, Super Admin), the listings for entries the logged in user could edit were wrong and were actually for the user who posted last.

here’s a screenshot showing two different users logged in (two different browsers) and having the same entries listed: http://drp.ly/hyhH

Here’s the code I’ve got for that area of the page:

<div id="jobpostings">
                <
h2>My Job Postings</h2>
                <
ul>
                    
{exp:channel:entries channel="jobs" author_id="CURRENT_USER"}
                    
<li>{title} <small><a href="{entry_id_path=members/post-job}">Edit</a></small><br /></li>
                    
{/exp:channel:entries}
                
</ul>
            </
div

I also tried using just one browser with two different, non-Super Admin users and got the same result. In fact, I logged in with one user that didn’t have *any* entries they posted (confirmed by checking in the EE CP) but the editable entries list still showed all the same ones as in the screenshot.

Any ideas??

angie

 Signature 

Angie Herrera | Portland Web Design: 420 Creative
@420creative | @angieherreraEE Pro Network

Profile
 
 
Posted: 06 October 2010 05:36 PM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Sounds like maybe a caching issue? The thing about caching in EE is that there are so many different cache settings. Try turning off all caching you can find and see if that fixes things.

It could also be a cookie issue, like maybe the 1st logout never actually worked or something. Try throwing {logged_in_member_id} in your template to see if that value is changing as you login and logout with different accounts.

Profile
 
 
Posted: 06 October 2010 08:54 PM   [ Ignore ]   [ # 2 ]
Has a Nice Profile
RankRank
Total Posts:  126
Joined  2010-06-18

Hm, still no go.

I added cache=“no” to exp:channel:entries. Query Caching and Template Caching are also both off.

I did add {logged_in_member_id} to the template and it does change with different logged in users.

I’m stuck. :/  Anything else I should check?

 Signature 

Angie Herrera | Portland Web Design: 420 Creative
@420creative | @angieherreraEE Pro Network

Profile
 
 
Posted: 06 October 2010 08:57 PM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

So it seems like the author_id param is not acting on CURRENT_USER for some reason. Wanna try this? PHP on input:

{exp:channel:entries channel="jobs" author_id="<?php echo $this->EE->session->userdata('member_id'); ?>"
Profile
 
 
Posted: 06 October 2010 09:34 PM   [ Ignore ]   [ # 4 ]
Has a Nice Profile
RankRank
Total Posts:  126
Joined  2010-06-18

Weird. Well, the PHP definitely worked. Thanks!!

 Signature 

Angie Herrera | Portland Web Design: 420 Creative
@420creative | @angieherreraEE Pro Network

Profile
 
 
Posted: 06 October 2010 09:34 PM   [ Ignore ]   [ # 5 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

This wouldn’t be the first EE oddity I’ve witnessed…

Profile