ansonphong / postworld

Wordpress Theme Development Framework
GNU General Public License v2.0
7 stars 0 forks source link

Search Page - Anonymous user #85

Closed michelhabib closed 8 years ago

michelhabib commented 10 years ago

There was an issue with anonymous user on the search page.

app.js

        pwGetPostStatusOptions: function( post_type ){
            // GET ROLE
            var current_user_role = $window.pwGlobals.current_user.roles[0];

This function gets the user role without checking if the user exists or has roles. so i added the following line

            if ((!$window.pwGlobals.current_user) || (!$window.pwGlobals.current_user)) {
                return;
            };

in that case it will not retrieve the post status options, not sure if that affects other functionality, probably not? can you please confirm?

Now, the anonymous search page loads fine, but is not returning any results. i looked into that and it turned to be similiar to the other issue where a plugin injects a filter on the comments for anonymous users. let me know if you need anything past this point.

ansonphong commented 10 years ago

ok interesting, thanks for pointing that out. I'll have a look at that.