asprin
Active member
I've this in the template:
My public controller looks like the following:
After clicking the delete icon from the UI, I'm getting the initial popup that says "Please confirm that you want to delete the following:". However, after clicking the "Delete" button, I'm getting an error that says the following:
Now this has me stumped as it's printing the correct value a line before that (line 22) but somehow doesn't seem to be recognizing it post that. Anything silly that I'm missing here?
HTML:
<xf:delete href="{{ link('foo/bar/delete', $foo, {'source':'a1'}) }}" />
My public controller looks like the following:
PHP:
public function actionDelete(ParameterBag $params)
{
$foo = $this->assertFooExists($params->sys_id);
if(!$foo->canDelete($error))
{
return $this->noPermission($error);
}
$source = trim($this->filter('source', 'str'));
if($source == 'b1')
{
$path = 'foo/bar/about';
$entity = $foo->About;
}
else if($source == 'a1')
{
$path = 'foo/bar/home';
$entity = $foo->Home;
}
//return $this->error($path); <-- this is printing foo/bar/home in the popup, so I've confirmation that it went into the correct if/else block
$link = $this->buildLink($path, $entity);
$plugin = $this->plugin('XF:Delete');
return $plugin->actionDelete(
$foo,
$this->buildLink('foo/bar/delete', $foo),
null,
$link,
$foo->title
);
}
After clicking the delete icon from the UI, I'm getting the initial popup that says "Please confirm that you want to delete the following:". However, after clicking the "Delete" button, I'm getting an error that says the following:
Now this has me stumped as it's printing the correct value a line before that (line 22) but somehow doesn't seem to be recognizing it post that. Anything silly that I'm missing here?