-
Notifications
You must be signed in to change notification settings - Fork 163
Description
Bug as reported:
(Main branch, last commit parent: a04236d1)
URL of page: <site>/notifications
Description of bug: A notification sent on an admin editing a MYO slot returns the wrong URL.
How was the bug caused (exact steps to reproduce): Have an admin edit the profile of a MYO slot, and make it notify the user. The user will then discover that the "View Character" link does not work.
Further details
Okay, let's be clear here. I already know the actual issue.
The MYO Controller (app\Http\Controller\Characters\MyoController.php) calls upon the updateCharacterProfile function of the Character Manager (app\Services\CharacterManager.php).
That Manager creates a notification by the name of CHARACTER_PROFILE_EDIT. In config\lorekeeper\notifications.php we can see that function uses 'character/{character_slug}/profile' for the url. Back in the Manager, the character slug is given as $character->slug.
This is a MYO Slot, however, and they don't have slugs. So I went to app\Model\Characters\Character.php and looked at the 'getSlugAttribute' function. There it is revealed that if it's a MYO slot, it will return the name.
Sleuthing aside, I'm unsure if we can just have it return $this->id in the model (since a MYO slot's url is based on the id) or if I need to build an exception in the updateCharacterProfile function of the Character Manager for MYOs.. I suppose it kind of depends on whether the slug attribute of MYO slots is used elsewhere..
...So I leave this to whichever enterprising mind wants to handle this one first. Go forth and test away.