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

Icon not found on notification page #2848

Closed
olexin-pro opened this issue Jun 26, 2024 · 1 comment
Closed

Icon not found on notification page #2848

olexin-pro opened this issue Jun 26, 2024 · 1 comment
Assignees
Labels

Comments

@olexin-pro
Copy link

Describe the bug
Error on notifications page:

Orchid\Icons\IconFinder::getContent(): Argument #3 ($dir) must be of type string, bool given, called in /opt/apps/app-source/vendor/orchid/blade-icons/src/IconFinder.php on line 66

To Reproduce
Steps to reproduce the behavior:

  1. Open the notifications page when there are no notifications

Expected behavior
Apparently it now throws an exception when there is no icon, I didn’t notice this behavior before

Server (please complete the following information):

  • Platfrom Version: 14.26
  • Laravel Version: 10.48
  • PHP Version: 8.1

Additional context
The iconNotFound method should return bs.bell in the NotificationTable class:

<?php

declare(strict_types=1);

namespace Orchid\Platform\Http\Layouts;

use Orchid\Screen\Layouts\Table;
use Orchid\Screen\TD;

class NotificationTable extends Table
{
    /**
     * Data source.
     *
     * @var string
     */
    public $target = 'notifications';

    /**
     * @return TD[]
     */
    public function columns(): array
    {
        return [
            TD::make('Message', __('Messages'))
                ->cantHide()
                ->render(static fn ($notification) => view('platform::partials.notification', [
                    'notification' => $notification,
                ])),
        ];
    }

    public function textNotFound(): string
    {
        return __('No notifications');
    }

    public function iconNotFound(): string
    {
        return 'bell';
    }

    public function subNotFound(): string
    {
        return __('You currently have no notifications, but maybe they will appear later.');
    }
}
@tabuna
Copy link
Member

tabuna commented Jun 29, 2024

Thank you for pointing out the missing prefix on the icon. I was unable to reproduce this issue on the latest version, likely due to the orchid/blade-icons package (tested on version 4). To prevent this issue, I have added the bs prefix, which is the default for Bootstrap icons. This prefix is available starting from version 14.26.1, so please update your package.

@tabuna tabuna closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants