i actualy tried to solve the same problem - my current fix looks like this:
i think spyros already intended to avoid that problem with slashes in the url, since he coded his ajaxrequest, with sending post-requests
but with array(‘show’,‘id’=>$model->name), the modelname just got into the get-request parameter… (which is valid since post-requests still can contain get-data)
the solution is, to encapsulate the ajax-call between <form></form> and inside this a hidden field with the id…
in my patch i moved the <?php echo SHtml::endForm();?> from the bottom directly under the searchbox ends, cause i guess nested form-tags aren’t allowed
thank you for your great extension, i hope i could help with this
edit:there is still something missing:
model/AuthItem.php
needs a public $id; in the beginning, else it will complain, that AuthItem has no attribute named id…
so this is mostly a hackish solution, but i’m new to yii and guess you’ll find the right solution sooner
diff --git a/protected/modules/srbac/views/authitem/manage/list.php b/protected/modules/srbac/views/authitem/manage/list.php
index 275a2d0..e17608d 100644
--- a/protected/modules/srbac/views/authitem/manage/list.php
+++ b/protected/modules/srbac/views/authitem/manage/list.php
@@ -84,6 +84,7 @@
?>
</div>
</div>
+ <?php echo SHtml::endForm();?>
<br />
<table class="srbacDataGrid">
<tr>
@@ -113,8 +114,11 @@
</tr>
<?php foreach($models as $n=>$model): ?>
<tr class="<?php echo $n%2?'even':'odd';?>">
- <td><?php echo SHtml::ajaxLink($model->name,
- array('show','id'=>$model->name),
+ <td>
+ <?php echo SHtml::beginForm();?>
+ <input type="hidden" name="id" value="<?= SHtml::encode($model->name)?>" />
+ <?php echo SHtml::ajaxLink($model->name,
+ array('show'),
array('type'=>'POST','update'=>'#preview',
'beforeSend' => 'function(){
$("#preview").addClass("srbacLoading");
@@ -123,14 +127,18 @@
$("#preview").removeClass("srbacLoading");
}',
), array("title"=>$model->description ? $model->description : $model->name)
- ); ?></td>
+ ); ?>
+ <?php echo SHtml::endForm();?>
+ </td>
<td><?php echo SHtml::encode(AuthItem::$TYPES[$model->type]); ?></td>
<td>
+ <?php echo SHtml::beginForm();?>
+ <input type="hidden" name="id" value="<?= SHtml::encode($model->name)?>" />
<?php echo SHtml::ajaxLink(
SHtml::image($this->module->getIconsPath().'/update.png',
Helper::translate('srbac','Update'),
array('border'=>0,'title'=>Helper::translate('srbac','Update'))),
- array('update','id'=>$model->name),
+ array('update'),
array(
'type'=>'POST',
'update'=>'#preview',
@@ -140,6 +148,7 @@
'complete' => 'function(){
$("#preview").removeClass("srbacLoading");
}',))?>
+ <?php echo SHtml::endForm();?>
</td>
<td>
<?php if ($model->name != Helper::findModule('srbac')->superUser) { ?>
@@ -163,7 +172,6 @@
</tr>
<?php endforeach; ?>
</table>
- <?php echo SHtml::endForm();?>
<br />
<div class="simple">
<?php $this->widget('CLinkPager',array(