Closed denistorresan closed 8 years ago
Hey, I fixed SleepingOwl\Admin\Form\Element\View class, source (/vendor/laravelrus/sleepingowl/src/Form/Element/View.php) in this way (I copy from Html.php).
parent::__construct();
in constructorhere the working code:
<?php
namespace SleepingOwl\Admin\Form\Element;
class View extends Custom
{
/**
* @var string
*/
protected $view;
/**
* @param string $view
*/
public function __construct($view)
{
$this->setView($view);
parent::__construct();
}
/**
* @return string
*/
public function getView()
{
return $this->view;
}
/**
* @param string $view
*
* @return $this
*/
public function setView($view)
{
$this->view = $view;
$this->setDisplay(function ($model) {
return view($this->getView(), ['model' => $model]);
});
return $this;
}
/*
public function save()
{
$callback = $this->getCallback();
if (is_callable($callback)) {
call_user_func($callback, $this->getModel());
}
}
*/
}
Hello, I recently updates the SleepingOwl package (from 4.17.88-beta to 4.41.8), and now all 'views' I defined into forms goes to error. My form is like:
and I got this error when I try to edit an element:
FatalErrorException in Assets.php line 76: Call to a member function getName() on null
When I comment
AdminFormElement::view
all works good, so maybe there's some changes into 'View' class. I never figure out how to fix it, also because I never found an example on Demo about 'View'.I also try calling the method
AdminFormElement::view('')
, same error.Thank you! Denis