2.6.1 admin-ajax.php 403 error on Export Entries unless Admin

I have the exact same problem as noted in this closed topic: Ajax Error for Specific Users

To recreate the issue:

Use Gravity Forms version 2.6.1

Log in to WordPress backend as an Editor

Go to Import/Export

Select a form from the Select a form dropdown

You will see a javascript alert that an ajax error has occurred and you won’t be able to take further steps to export entries.

In the JS console, you can see that a 403 is being thrown on admin-ajax.php.

The workaround mentioned in the topic is to to add the gravityforms_edit_forms capability to the role temporarily, which I’ve done.

For those needing to know how to add a capability without a plugin, something like this in your functions.php will do it.

	/* make gravity forms export available to Editor role */
	function add_gf_cap() {
		$role = get_role( 'editor' );
		$role->add_cap( 'gravityforms_edit_forms' );
			After the problem where editors can't select a form to export its entries is fixed, remove the edit form capability from the editor role:
				Comment or remove $role->add_cap( 'gravityforms_edit_forms' );, above.
				Uncomment $role->remove_cap( 'gravityforms_edit_forms' );, below.
				Log in as an editor to make this run and verify that Editors can no longer edit forms.
				Then I think you can remove this function and the add_action call.
		//$role->remove_cap( 'gravityforms_edit_forms' );
	add_action( 'admin_init', 'add_gf_cap' );

Essentially, since that topic is closed, I wanted to verify that it’s still actually being investigated. It’s not clear to me that it is, since the last comment before the topic is closed asks the OP to submit a ticket (possibly about how to remove the temporary capability?).


Yes, my ticket is still open so my assumption is that they’re still working on it. You may want to submit a ticket, as well. Hopefully it gets resolved soon.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.