pxlrbt\FilamentSpotlight\Actions\RegisterUserMenu::getUrl(): Return value must be of type string, null returned #38

Closed
opened 2023-12-31 23:41:03 +00:00 by grafidev · 5 comments
grafidev commented 2023-12-31 23:41:03 +00:00 (Migrated from github.com)

pxlrbt\FilamentSpotlight\Actions\RegisterUserMenu::getUrl(): Return value must be of type string, null returned

pxlrbt\FilamentSpotlight\Actions\RegisterUserMenu::getUrl(): Return value must be of type string, null returned
melvinmihaylovnulabg commented 2024-11-10 15:41:23 +00:00 (Migrated from github.com)

Hello, i have the same issue and i am with the latest version of the plugin. Do i need to install another version or what?

Hello, i have the same issue and i am with the latest version of the plugin. Do i need to install another version or what?
jacquestrdx123 commented 2024-11-18 07:43:53 +00:00 (Migrated from github.com)

Same issue, not sure how to move forward

Same issue, not sure how to move forward
jacquestrdx123 commented 2024-11-18 07:49:37 +00:00 (Migrated from github.com)

Btw, my issue I found the cause by going into the vendor file RegisterUserMenu.php and adding a try catch TypeError, then I was able to find the menu item causing the plugin to crash

public static function boot(Panel $panel)
{
$self = new static;
/**
* @var array $items
*/
$items = $panel->getUserMenuItems();

    foreach ($items as $key => $item) {
        $name = $self->getName($key, $item);
        try{
            $url = $self->getUrl($key, $item);
        }catch (\TypeError $e){
            dd($item);
            $url = '';
        }
Btw, my issue I found the cause by going into the vendor file RegisterUserMenu.php and adding a try catch TypeError, then I was able to find the menu item causing the plugin to crash public static function boot(Panel $panel) { $self = new static; /** * @var array<MenuItem> $items */ $items = $panel->getUserMenuItems(); foreach ($items as $key => $item) { $name = $self->getName($key, $item); try{ $url = $self->getUrl($key, $item); }catch (\TypeError $e){ dd($item); $url = ''; }
pxlrbt commented 2024-11-18 11:52:40 +00:00 (Migrated from github.com)

then I was able to find the menu item causing the plugin to crash

Is it a default one and a use case that should be supported? We could probably filter out results with an empty url

> then I was able to find the menu item causing the plugin to crash Is it a default one and a use case that should be supported? We could probably filter out results with an empty url
jacquestrdx123 commented 2024-11-18 13:19:26 +00:00 (Migrated from github.com)

Hi

It was a custom User Menu I had included

return $panel

->userMenuItems([
    'profile' => MenuItem::make()->label('Edit profile'),
])
Hi It was a custom User Menu I had included return $panel ->userMenuItems([ 'profile' => MenuItem::make()->label('Edit profile'), ])
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pxlrbt/filament-spotlight#38
No description provided.