Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Return slug when entry is saved from frontend #2792

Closed
menberg opened this issue Apr 23, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@menberg
Copy link

commented Apr 23, 2018

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

  • Craft version: 3.0.3.1
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Apr 23, 2018

Added for the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.