open-admin-org / open-admin

open-admin forked from z-song/laravel-ladmin. Removing jquery, now based on Bootstrap5, vanilla JS
https://open-admin.org
MIT License
245 stars 71 forks source link

Error when using Addlink of Tab Widgets #57

Open hrs-o opened 1 year ago

hrs-o commented 1 year ago

Describe the bug refs #51

Error when using Addlink of Tab Widgets.

To Reproduce

public function index(Content $content): Content
{
    $tab = new Tab();
    $tab->addLink('1', 'A', false);
    $tab->addLink('2', 'B', false);
    $tab->addLink('3', 'C', true); 
    return $content->row($tab);
}
public function index(Content $content): Content
{
    $tab = new Tab();
    $tab->add('1', 'A', false);
    $tab->addLink('2', 'B', false);
    $tab->addLink('3', 'C', true); 
    return $content->row($tab);
}

In the Tab class, href or ref is put in the $this->data['tabs'] depending on the type, but there is always a place where ref is called in the view.

https://github.com/open-admin-org/open-admin/blob/v1.0.27/src/Widgets/Tab.php#L76-L81 https://github.com/open-admin-org/open-admin/blob/v1.0.27/resources/views/widgets/tab.blade.php#L30-L32

Expected behavior

No error when using addLink.

System

open-admin-org commented 1 year ago

@hrs-o thanks for reporting (sorry for introducting a new bug with the last fix). Will be fixed in the next release. dev-develop branch already has the fix.