Subject: | Consecutive 'Add New' updates previous data |
Date: | Fri, 26 Dec 2008 10:45:29 -0600 |
To: | bug-CatalystX-ListFramework-Builder [...] rt.cpan.org |
From: | "James R. Leu" <jleu [...] mindspring.com> |
I'm not sure the best way to report this. First I'll describe the issue
then provide my config, and then snippets of output from the cat app.
I've tried to dig into the code, but everything leads me back to
the sneaking suspicion that I have something setup wrong.
Description
===========
After restarting the catalyst app, I can click the 'Add new' button and
successfully add a new row of data (row_new). Every subsequent attempt to
use the 'Add new' button will result 'row_new' getting updated instead
of a new row being inserted. This continues until I restart the catalyst app.
Attempt to refresh the app (web browser reload) does not change the behavior.
Config
======
demo.conf
---------
extjs2 /static/ext-2.2
<Model::LFB::DBIC>
schema_class FOO
connect_info dbi:mysql:dbname=FOO;host=localhost;port=3321;
connect_info username
connect_info password
<connect_info>
AutoCommit 1
</connect_info>
</Model::LFB::DBIC>
FOO.pm
------
package FOO;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_classes({
FOO => [qw/
OutageData
/],
});
1;
FOO/OutageData.pm
-----------------
package ATC::OutageData;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/PK::Auto Core/);
__PACKAGE__->table('OutageData');
__PACKAGE__->add_columns(
id => {
is_auto_increment => 1,
data_type => 'integer',
is_nullable => 0,
default_value => '',
},
Device_ID,
Ticket_Number,
Carrier_Name,
Site_ID,
Bands_Affected,
Duration_of_Outage,
Number_of_Antenna,
);
__PACKAGE__->set_primary_key('id');
1;
mysql schema
------------
CREATE TABLE `OutageData` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`Device_ID` varchar(64) NOT NULL,
`Ticket_Number` varchar(64) NOT NULL,
`Carrier_Name` varchar(64) NOT NULL,
`Site_ID` varchar(64) NOT NULL,
`Bands_Affected` varchar(64) NOT NULL,
`Duration_of_Outage` float NOT NULL,
`Number_of_Antenna` float NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM
Catalyst App debug
==================
I uncommented the debug statements in 'AJAX::update'
First 'add new' after cat app started
-------------------------------------
$VAR1 = [
{
'Device_ID' => '1111',
'Bands_Affected' => 'None',
'Ticket_Number' => '2222',
'Carrier_Name' => 'Leu',
'Number_of_Antenna' => '4',
'Site_ID' => '3333',
'Duration_of_Outage' => '4'
},
'LFB::DBIC::OutageData'
];
BEGIN WORK
SELECT me.id, me.Device_ID, me.Ticket_Number, me.Carrier_Name, me.Site_ID, me.Bands_Affected, me.Duration_of_Outage, me.Number_of_Antenna FROM OutageData me WHERE ( ( me.id IS NULL ) ):
INSERT INTO OutageData (Bands_Affected, Carrier_Name, Device_ID, Duration_of_Outage, Number_of_Antenna, Site_ID, Ticket_Number) VALUES (?, ?, ?, ?, ?, ?, ?): 'None', 'Leu', '1111', '4', '4', '3333', '2222'
COMMIT
[info] *** Request 5 (0.143/s) [19962] [Fri Dec 26 10:19:56 2008] ***
[debug] Body Parameters are:
.-------------------------------------+--------------------------------------.
| Parameter | Value |
+-------------------------------------+--------------------------------------+
| Bands_Affected | None |
| Carrier_Name | Leu |
| Device_ID | 1111 |
| Duration_of_Outage | 4 |
| Number_of_Antenna | 4 |
| Site_ID | 3333 |
| Ticket_Number | 2222 |
| id | |
'-------------------------------------+--------------------------------------'
Next add new
------------
$VAR1 = [
{
'Device_ID' => '4444',
'Bands_Affected' => 'None',
'Ticket_Number' => '55555',
'Carrier_Name' => 'Leu',
'Number_of_Antenna' => '5',
'Site_ID' => '66666',
'Duration_of_Outage' => '5'
},
'LFB::DBIC::OutageData'
];
BEGIN WORK
SELECT me.id, me.Device_ID, me.Ticket_Number, me.Carrier_Name, me.Site_ID, me.Bands_Affected, me.Duration_of_Outage, me.Number_of_Antenna FROM OutageData me WHERE ( ( me.id IS NULL ) ):
UPDATE OutageData SET Device_ID = ?, Duration_of_Outage = ?, Number_of_Antenna = ?, Site_ID = ?, Ticket_Number = ? WHERE ( id = ? ): '4444', '5', '5', '66666', '55555', '24'
COMMIT
[info] *** Request 7 (0.125/s) [19962] [Fri Dec 26 10:20:17 2008] ***
[debug] Body Parameters are:
.-------------------------------------+--------------------------------------.
| Parameter | Value |
+-------------------------------------+--------------------------------------+
| Bands_Affected | None |
| Carrier_Name | Leu |
| Device_ID | 4444 |
| Duration_of_Outage | 5 |
| Number_of_Antenna | 5 |
| Site_ID | 66666 |
| Ticket_Number | 55555 |
| id | |
'-------------------------------------+--------------------------------------'
--
James R. Leu
jleu@mindspring.com
Message body not shown because it is not plain text.