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

Notification on MYO Slot Profile edits return wrong url #558

Open
SpeedyD opened this issue Mar 11, 2023 · 0 comments · Fixed by #735
Open

Notification on MYO Slot Profile edits return wrong url #558

SpeedyD opened this issue Mar 11, 2023 · 0 comments · Fixed by #735
Labels
bug Something isn't working

Comments

@SpeedyD
Copy link
Contributor

SpeedyD commented Mar 11, 2023

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.

@itinerare itinerare added the bug Something isn't working label Mar 11, 2023
Ne-wt added a commit to Ne-wt/lorekeeper that referenced this issue Dec 6, 2023
@itinerare itinerare linked a pull request Dec 7, 2023 that will close this issue
itinerare pushed a commit that referenced this issue Dec 10, 2023
* fix issue #728

* fix #96

* fix #113

* Update birthday selector on register

* fix #225

* fix #226

* fix #346

* fix #558

* fix #460

* fix #459

* fix #91

* Apply fixes from #91 to prompt submissions

* refactor: fix blade formatting

* remove character item retention due to return input wackiness

* refactor: fix PHP styling

* array_unique on slugs for gallery

* add missing set active on user sidebars

* add comment history and bugfix for likes

* refactor: fix blade formatting

* tweak function docs and sales comments checks

* refactor: fix blade formatting

* Capitalise 'carbon' in UserService

* refactor: fix PHP styling

---------

Co-authored-by: Ne-wt <Ne-wt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants