Skip Menu |

This queue is for tickets about the DBIx-Class-Tree-NestedSet CPAN distribution.

Report information
The Basics
Id: 59319
Status: resolved
Priority: 0/
Queue: DBIx-Class-Tree-NestedSet

People
Owner: Nobody in particular
Requestors: leonardo [...] ruoso.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: I can't add a root node!
DBIx::Class::Row::update_or_insert(): DBI Exception: DBD::Pg::st execute failed: ERRO: sintaxe de entrada é inválida para integer: "id" [for Statement "UPDATE site_categoria SET site_categoria_id = ? WHERE ( id = ? )" with ParamValues: 1='id', 2='3'] at /usr/share/perl5/HTML/FormFu/Model/DBIC.pm line 414 Using Debian Gnu/Linux; Linux yuri 2.6.32-5-686 #1 SMP Sun Jul 11 02:12:03 UTC 2010 i686 GNU/Linux DBIx::Class::Tree::NestedSet is up to date (0.07). This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi Using Catalyst::HTML::FormFu!
From: leonardo [...] ruoso.com

Message body is not shown because it is too large.

On Tue Jul 13 10:45:46 2010, leonardo.ruoso wrote: Show quoted text
> DBIx::Class::Row::update_or_insert(): DBI Exception: DBD::Pg::st execute > failed: ERRO: sintaxe de entrada é inválida para integer: "id" [for > Statement "UPDATE site_categoria SET site_categoria_id = ? WHERE ( id = > ? )" with ParamValues: 1='id', 2='3'] at > /usr/share/perl5/HTML/FormFu/Model/DBIC.pm line 414 > > Using Debian Gnu/Linux; > Linux yuri 2.6.32-5-686 #1 SMP Sun Jul 11 02:12:03 UTC 2010 i686 GNU/Linux > > DBIx::Class::Tree::NestedSet is up to date (0.07). > > This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi > > Using Catalyst::HTML::FormFu!
DBIx::Class::Tree::NestedSet is not part of the DBIC core. Is there a specific reason you filed the bug here? If not - please refile under ::Tree::NestedSet as most of the DBIC hackers do not have the necessary insight to iagnose and fix your problem. http://search.cpan.org/~icydee/DBIx-Class-Tree-NestedSet-0.07/lib/DBIx/Class/Tree/NestedSet.pm Stalling pending possible not-our-bug rejection
Subject: Re: [rt.cpan.org #59319] I can't add a root node!
Date: Sun, 8 Aug 2010 08:28:33 -0300
To: bug-DBIx-Class [...] rt.cpan.org
From: Leonardo Ruoso <leonardo [...] ruoso.com>
Sorry, just followed the links.... · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Leonardo Ruoso (CE1921JP) http://lattes.cnpq.br/2719086566536387 - http://br.linkedin.com/in/lruoso leonardo@oktiva.com.br - (85) 8787-0312 - sip:87870312@ekiga.net<sip%3A87870312@ekiga.net> Marketing, Comunicação Social e Tecnologia http://norvig.com/21-days.html 2010/8/8 Peter Rabbitson via RT <bug-DBIx-Class@rt.cpan.org> Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=59319 > > > On Tue Jul 13 10:45:46 2010, leonardo.ruoso wrote:
> > DBIx::Class::Row::update_or_insert(): DBI Exception: DBD::Pg::st execute > > failed: ERRO: sintaxe de entrada é inválida para integer: "id" [for > > Statement "UPDATE site_categoria SET site_categoria_id = ? WHERE ( id = > > ? )" with ParamValues: 1='id', 2='3'] at > > /usr/share/perl5/HTML/FormFu/Model/DBIC.pm line 414 > > > > Using Debian Gnu/Linux; > > Linux yuri 2.6.32-5-686 #1 SMP Sun Jul 11 02:12:03 UTC 2010 i686
> GNU/Linux
> > > > DBIx::Class::Tree::NestedSet is up to date (0.07). > > > > This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi > > > > Using Catalyst::HTML::FormFu!
> > DBIx::Class::Tree::NestedSet is not part of the DBIC core. Is there a > specific reason you filed the bug here? If not - please refile under > ::Tree::NestedSet as most of the DBIC hackers do not have the necessary > insight to iagnose and fix your problem. > > > http://search.cpan.org/~icydee/DBIx-Class-Tree-NestedSet-0.07/lib/DBIx/Class/Tree/NestedSet.pm<http://search.cpan.org/%7Eicydee/DBIx-Class-Tree-NestedSet-0.07/lib/DBIx/Class/Tree/NestedSet.pm> > > Stalling pending possible not-our-bug rejection > > > >
From: moritz [...] faui2k3.org
FWIW I also get the same error. The bug is in this piece of code: if (!defined $row->$root) { my @primary_columns = $row->result_source->primary_columns; if (scalar @primary_columns > 1) { croak('Only single column primary keys are supported for default root selection in nested set tree classes'); } $row->update({ $root => $primary_columns[0], }); $row->discard_changes; If the primary column is 'id', then it tries to update $root => 'id', which is a string and not an int. This is a possible fix: --- a/lib/DBIx/Class/Tree/NestedSet.pm +++ b/lib/DBIx/Class/Tree/NestedSet.pm @@ -119,7 +119,7 @@ sub insert { } $row->update({ - $root => $primary_columns[0], + $root => \"$primary_columns[0]", }); $row->discard_changes; I didn't add a test because I don't quite understand the tests - it seems to me that the insert tests are skipped by default anyway?
Fix will be in release 0.09 Thank you Ian