Hi,
Is it possible to reopen this topic?
https://toolset.com/forums/topic/ajax-pagination-does-not-work-with-nested-view-2/
I recovered the error logs, where can I upload them?
thanks you
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Unfortunately due to the amount of time that has passed i'm not able to re-open the ticket.
What I recommend is that you upload the logs to Google Drive or Dropbox and share the file with me.
Thanks,
Shane
Hi Shane,
here you can find the logs:
hidden link
I noticed on admin-ajax.php a 302 redirect when I try to change pagination with the custom role as if it doesn't have the right permissions to access the content
thank you
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Perhaps there is some permissions issue for your server.
What you can do is to contact your server hosts and have them look at this error for you.
Additionally you can work around this by recreating the user role and then copying the permissions from one of the roles that work.
From there you can re-assign the users to the recreated role.
Thanks,
Shane
Hi Shane,
I did some tests with WordPress default roles.
The subscriber role also has the same problem with pagination.
The permission required for pagination to work properly is "edit_posts".
This is potentially a problem because users under the "Agenti IT" role must not be able to edit posts or access the WordPress administrative area but only this page:
hidden link
Is there a reason why this permission is required in order to use pagination?
thank you
Hi Shane,
I think I have found a solution, I had added this code to prevent users with the "Agenti IT" role from reaching the WordPress dashboard.
function wpse66093_no_admin_access() {
$redirect = home_url( '/' );
if ( is_admin() && !current_user_can( 'edit_posts' ) ) {
wp_redirect($redirect);
exit();
}
}
add_action( 'admin_init', 'wpse66093_no_admin_access' );
However, it seems to create problems with pagination, the problem seems to be solved by adding this this "!wp_doing_ajax()" to condition:
function wpse66093_no_admin_access() {
$redirect = home_url( '/' );
if (is_admin() && !wp_doing_ajax() && !current_user_can( 'edit_posts' ) ) { // delete_posts
wp_redirect($redirect);
exit();
}
}
add_action( 'admin_init', 'wpse66093_no_admin_access' );
thank you
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Meg,
I'm happy to see that you're able to solve the issue as well as sharing it here as it might be helpful to other users as well.
Thanks,
Shane
My issue is resolved now. Thank you!