changing slider ‘slug’ fails (401 unauthorized) on POST to wp-ajax.php
-
First off — thanks so much for crafting such a wonderful plugin!
For v1.3.8 of the plugin we discovered a slight bug in that an admin user is unable to update the
slug
value of a slider. In the browser’s web console this error was occurring:Failed to load resource: the server responded with a status of 401 (Unauthorized)
on the POST to/wp-admin/admin-ajax.php
after making a change under Depicter->Options->General->”Slider Slug”.On line 113 of
depicter/app/routes/ajax.php
for the current v1.3.8 plugin if this line is modified from
->middleware('csrf-api:depicter-dashboard' )
to
->middleware('csrf-api:depicter-editor|depicter-dashboard' )
then an admin user is able to successfully modify the ‘slug’ of a slider under Depicter->Options->General->”Slider Slug”. The above code was taken from the successfully working code to rename a slider from line 45
depicter/app/routes/ajax.php
as shown with context below:// Renames a document Depicter::route()->methods(['POST']) ->where( 'ajax', 'depicter/document/name/change', true, true ) ->middleware('csrf-api:depicter-editor|depicter-dashboard' ) ->middleware('userCan:edit_depicter' ) ->handle( 'DashboardAjaxController@changeName' );
I hope the above is intelligible and proves useful. Thanks again for sharing such a great plugin with the wordpress community!
The page I need help with: [log in to see the link]
- The topic ‘changing slider ‘slug’ fails (401 unauthorized) on POST to wp-ajax.php’ is closed to new replies.