Log1x/crumb

Url is set to 1

Androlax2 opened this issue · 0 comments

Hi,

On blog pages, url in the breadcrumb for the last item is set to 1.

Here is a dump of my items :

array:2 [▼
  0 => array:2 [▼
    "label" => "Accueil"
    "url" => "http://dev.cormary.com:8888"
  ]
  1 => array:2 [▼
    "label" => "Acide hyaluronique"
    "url" => "1"
  ]
]

I think, it come from that :

if (is_category()) {
            return $this->add(
                single_cat_title('', false),
                true
            );
        }

Why is there a true as second parameter? I have set the method to :

protected function add(string $key, ?string $value = null, bool $blog = false)

I think $value is casted to a string when pushing the url in

 $this->breadcrumb->push(
            [
                'label' => $key,
                'url'   => $value,
            ]
        );