open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

Error when using Addlink of Tab Widgets

Open hrs-o opened this issue 2 years ago • 1 comments

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 version
  • PHP version
    • PHP/8.2.3
  • Laravel Version
    • 10.1.5
  • OS:
    • Linux
  • Browser
    • chrome

hrs-o avatar Apr 03 '23 04:04 hrs-o

@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.

open-admin-org avatar May 11 '23 12:05 open-admin-org