Robust
Well-known member
Here's part of my template:
The form is sent to the edit (actionGroupsEdit)
<xen:form action="{xen:adminlink apgroups/groups/edit}" class="section">
While on the groups list, if I dump the $group var, it dumps fine and contains a group_id. My problem is that when you are redirected by clicking on the list item, the group_id var suddenly disappears and it errors out saying no group ID exists, and that's right, I tried dumping $this->_input and it doesn't contain any input vars thru GET or POST.
I'd really appreciate some help here. Probably another dumb play on my part.
Code:
<ol class="FilterList">
<xen:foreach loop="$groups" value="$group">
<xen:listitem
id="{$group.group_id}"
label="{$group.group_name}"
href="{xen:adminlink 'apgroups/groups/edit', $group}"
delete="{xen:adminlink 'apgroups/groups/delete', $group}">
</xen:listitem>
</xen:foreach>
</ol>
Code:
protected function _getGroupAddEditResponse($group)
{
$viewParams = array(
'group' => $group
);
return $this->responseView('Apantic_Groups_ViewAdmin_Groups_AddEdit', 'apgg_group_edit', $viewParams);
}
public function actionGroupsAdd()
{
return $this->_getGroupAddEditResponse(array());
}
public function actionGroupsEdit()
{
$groupId = $this->_input->filterSingle('group_id', XenForo_Input::UINT);
$group = $this->_getGroupOrError($groupId);
return $this->_getGroupAddEditResponse($group);
}
The form is sent to the edit (actionGroupsEdit)
<xen:form action="{xen:adminlink apgroups/groups/edit}" class="section">
While on the groups list, if I dump the $group var, it dumps fine and contains a group_id. My problem is that when you are redirected by clicking on the list item, the group_id var suddenly disappears and it errors out saying no group ID exists, and that's right, I tried dumping $this->_input and it doesn't contain any input vars thru GET or POST.
Code:
protected function _getGroupOrError($id)
{
$info = $this->_getGroupsModel()->getGroupById($id);
if(!$info)
{
throw $this->responseException($this->responseError(new XenForo_Phrase('apgg_group_not_found'), 404));
}
return $info;
}
I'd really appreciate some help here. Probably another dumb play on my part.