[Docs] Add missing if statement to guide on slug generation#8554
Merged
derrickmehaffy merged 1 commit intostrapi:documentationfrom Nov 3, 2020
walsquared:Walsker-patch-1
Merged
[Docs] Add missing if statement to guide on slug generation#8554derrickmehaffy merged 1 commit intostrapi:documentationfrom walsquared:Walsker-patch-1
derrickmehaffy merged 1 commit intostrapi:documentationfrom
walsquared:Walsker-patch-1
Conversation
The lack of if statement generates runtime errors when following this guide. Signed-off-by: Walsker <walsker@walwal.me>
Author
hdeadman
pushed a commit
to hdeadman/strapi
that referenced
this pull request
Nov 12, 2020
The lack of if statement generates runtime errors when following this guide. Signed-off-by: Walsker <walsker@walwal.me>
petersg83
pushed a commit
that referenced
this pull request
Nov 13, 2020
The lack of if statement generates runtime errors when following this guide. Signed-off-by: Walsker <walsker@walwal.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
After following this guide, I was receiving server errors in my app when attempting to publish content whose content type had an automatically generated slug. I found that the lack of if statement generates runtime errors.
What does it do?
I added an if statement to the code snippet.
Why is it needed?
Generates errors on other events that invoke the lifecycle method.
Related issue(s)/PR(s)
N/A