You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When submitting entries from the frontend via HTTP POST requests, Craft returns properties like id, title and authorUsername as JSON, but not slug.
To redirect the author to the newly saved entry, we need to have the slug of the entry. Right now, it's necessary to send an additional request to Craft to get the slug of the entry.
Would it be possible to add slug to the returned properties after submitting entries via POST requests?
Description
When submitting entries from the frontend via HTTP POST requests, Craft returns properties like id, title and authorUsername as JSON, but not slug.
To redirect the author to the newly saved entry, we need to have the slug of the entry. Right now, it's necessary to send an additional request to Craft to get the slug of the entry.
Would it be possible to add slug to the returned properties after submitting entries via POST requests?
Steps to solve
Add
$return['slug'] = $entry->slug;
over here:https://github.com/craftcms/cms/blob/develop/src/controllers/EntriesController.php#L565
Additional info
The text was updated successfully, but these errors were encountered: