AjaxRequest failed when editing a row with date or dateTime columns

Bug #588143 reported by David Roth
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
chive
Fix Released
High
David Roth

Bug Description

I get an "Undefined index: id" exception when editing a complete row with at least one date || dateTime column.

<!DOCTYPE html PUBLIC
 "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>
PHP Error</title>
</head>

<body>
<h1>PHP Error</h1>

<h3>Description</h3>
<p class="message">
Undefined index: id</p>

<h3>Source File</h3>
<p>
/var/www/chive/protected/components/InputField.php(99)</p>

<div class="source">
<pre>
00087: echo '<script type="text/javascript">
00088: $(document).ready(function() {
00089: $("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd", buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
00090: });
00091: </script>';
00092: break;
00093:
00094: case 'datetime':
00095: echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
00096: echo '<script type="text/javascript">
00097: $(document).ready(function() {
00098: now = new Date();
<div class="error">00099: $("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd " + now.getHours() + ":" + now.getMinutes() + ":00", buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
</div>00100: });
00101: </script>';
00102: break;
00103:
00104: default:
00105: echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
00106: break;
00107: }
00108:
00109: }
00110:
00111: public function getEnumValues()
</pre>
</div><!-- end of source -->

<h3>Stack Trace</h3>
<div class="callstack">
<pre>
#0 /var/www/chive/yii/web/CBaseController.php(161): InputField->run()
#1 /var/www/chive/protected/runtime/views/65ba1e9c/formBody.php(37): RowController->widget()
#2 /var/www/chive/yii/web/CBaseController.php(119): require()
#3 /var/www/chive/yii/web/renderers/CViewRenderer.php(77): RowController->renderInternal()
#4 /var/www/chive/yii/web/CBaseController.php(86): CPradoViewRenderer->renderFile()
#5 /var/www/chive/yii/web/CController.php(742): RowController->renderFile()
#6 /var/www/chive/protected/controllers/RowController.php(380): RowController->renderPartial()
#7 /var/www/chive/yii/web/actions/CInlineAction.php(32): RowController->actionEdit()
#8 /var/www/chive/yii/web/CController.php(300): CInlineAction->run()
#9 /var/www/chive/yii/web/filters/CFilterChain.php(129): RowController->runAction()
#10 /var/www/chive/yii/web/filters/CFilter.php(41): CFilterChain->run()
#11 /var/www/chive/yii/web/CController.php(993): CAccessControlFilter->filter()
#12 /var/www/chive/yii/web/filters/CInlineFilter.php(59): RowController->filterAccessControl()
#13 /var/www/chive/yii/web/filters/CFilterChain.php(126): CInlineFilter->filter()
#14 /var/www/chive/yii/web/CController.php(283): CFilterChain->run()
#15 /var/www/chive/yii/web/CController.php(257): RowController->runActionWithFilters()
#16 /var/www/chive/yii/web/CWebApplication.php(320): RowController->run()
#17 /var/www/chive/yii/web/CWebApplication.php(120): CWebApplication->runController()
#18 /var/www/chive/yii/base/CApplication.php(135): CWebApplication->processRequest()
#19 /var/www/chive/index.php(76): CWebApplication->run()
</pre>
</div><!-- end of callstack -->

<div class="version">
2010-06-01 08:11:04 Apache/2.2.14 (Ubuntu) <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.1</div>
</body>
</html>

Related branches

David Roth (davrot)
description: updated
Revision history for this message
David Roth (davrot) wrote :

The unset $htmlOptions['id'] seems to be the problem here. So this does not work when there are date or dateTime columns.

Changed in chive:
assignee: nobody → David Roth (davrot)
importance: Undecided → High
milestone: none → 0.4.0
status: New → Triaged
summary: - AjaxRequest failed when editing a row
+ AjaxRequest failed when editing a row with date or dateTime columns
description: updated
Revision history for this message
David Roth (davrot) wrote :

Fixed in trunk

Changed in chive:
status: Triaged → Fix Committed
David Roth (davrot)
Changed in chive:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.