mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding fix for AjaxHelper::form() (Ticket #3582)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6104 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
73d4844b22
commit
a61b32c91e
2 changed files with 8 additions and 0 deletions
|
@ -318,6 +318,9 @@ class AjaxHelper extends AppHelper {
|
|||
),
|
||||
$options
|
||||
);
|
||||
foreach (array_keys($options) as $key) {
|
||||
unset($htmlOptions[$key]);
|
||||
}
|
||||
|
||||
return $this->Form->create($options['model'], $htmlOptions)
|
||||
. $this->Javascript->event("'" . $htmlOptions['id']. "'", 'submit', $this->remoteFunction($options));
|
||||
|
|
|
@ -115,6 +115,11 @@ class AjaxTest extends UnitTestCase {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testForm() {
|
||||
$result = $this->Ajax->form('showForm', 'post', array('model' => 'Form', 'url' => array('action' => 'showForm', 'controller' => 'forms'), 'update' => 'form_box'));
|
||||
$this->assertNoPattern('/model=/', $result);
|
||||
}
|
||||
|
||||
function testSortable() {
|
||||
$result = $this->Ajax->sortable('ull', array('constraint'=>false,'ghosting'=>true));
|
||||
$expected = '<script type="text/javascript">Sortable.create(\'ull\', {constraint:false, ghosting:true});</script>';
|
||||
|
|
Loading…
Reference in a new issue