Skip Menu |

This queue is for tickets about the REST-Neo4p CPAN distribution.

Report information
The Basics
Id: 91748
Status: resolved
Priority: 0/
Queue: REST-Neo4p

People
Owner: maj.fortinbras [...] gmail.com
Requestors: kevin.pluck [...] ivendi.com
Cc:
AdminCc:

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



Subject: Cannot create_unique with value 0
Date: Mon, 30 Dec 2013 23:57:07 +0000
To: bug-REST-Neo4p [...] rt.cpan.org
From: Kevin Pluck <kevin.pluck [...] ivendi.com>
Hello, I've tracked down a bug where creating a unique node with create_unique and storing the value 0 or '0' results in the error: Args required: key => value, hashref_of_properties Here is some code that replicates the problem: ### use REST::Neo4p; use strict; use warnings; REST::Neo4p->connect('http://127.0.0.1:7474'); my $index = REST::Neo4p::Index->new('node', 'index'); print "x\n"; my $node1 = $index->create_unique(foo => "x", {foo => "x"}); # Works print "0\n"; my $node2 = $index->create_unique(bar => "0", {bar => "0"}); # Doesn't work ### It's likely due to line 211 in Index.pm unless ($key && $value && $properties && (ref $properties eq 'HASH')) { Which as $value is 0 it is treated as a boolean false and fails this guard code. Version of Neo4p in use: REST::Neo4p ------------------------------------------------------------------------- CPAN: Module::CoreList loaded ok (v2.96) Perl object bindings for a Neo4j database M/MA/MAJENSEN/REST-Neo4p-0.2230.tar.gz C:\strawberry\perl\site\lib\REST\Neo4p.pm Installed: 0.2230 CPAN: 0.2230 up to date Mark Allen Jensen (MAJENSEN) jensen@fortinbras.us I am finding Neo4j absolutely fantastic to use and your perl library very easy and intuitive. Regards, Kevin. -- *Kevin Pluck* *i**V**endi Limited*
Thanks Kevin - very much appreciated. I will fix, pls look for v0.2231 shortly. MAJ On Mon Dec 30 18:57:15 2013, kevin.pluck@ivendi.com wrote: Show quoted text
> Hello, > > I've tracked down a bug where creating a unique node with create_unique and > storing the value 0 or '0' results in the error: > > Args required: key => value, hashref_of_properties > > Here is some code that replicates the problem: > ### > use REST::Neo4p; > use strict; > use warnings; > > REST::Neo4p->connect('http://127.0.0.1:7474'); > > > my $index = REST::Neo4p::Index->new('node', 'index'); > > print "x\n"; > my $node1 = $index->create_unique(foo => "x", {foo => "x"}); # Works > > print "0\n"; > my $node2 = $index->create_unique(bar => "0", {bar => "0"}); # Doesn't work > ### > > It's likely due to line 211 in Index.pm > > unless ($key && $value && $properties && (ref $properties eq 'HASH')) { > > Which as $value is 0 it is treated as a boolean false and fails this guard > code. > > Version of Neo4p in use: > REST::Neo4p > ------------------------------------------------------------------------- > CPAN: Module::CoreList loaded ok (v2.96) > Perl object bindings for a Neo4j database > M/MA/MAJENSEN/REST-Neo4p-0.2230.tar.gz > C:\strawberry\perl\site\lib\REST\Neo4p.pm > Installed: 0.2230 > CPAN: 0.2230 up to date > Mark Allen Jensen (MAJENSEN) > jensen@fortinbras.us > > I am finding Neo4j absolutely fantastic to use and your perl library very > easy and intuitive. > > Regards, > > Kevin. >
Subject: Re: [rt.cpan.org #91748] Cannot create_unique with value 0
Date: Tue, 31 Dec 2013 22:16:34 +0000
To: bug-REST-Neo4p [...] rt.cpan.org
From: Kevin Pluck <kevin.pluck [...] ivendi.com>
Fantastic! Happy new year! On 31 December 2013 22:13, Mark Allen Jensen via RT < bug-REST-Neo4p@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=91748 > > > Thanks Kevin - very much appreciated. I will fix, pls look for v0.2231 > shortly. > MAJ > On Mon Dec 30 18:57:15 2013, kevin.pluck@ivendi.com wrote:
> > Hello, > > > > I've tracked down a bug where creating a unique node with create_unique
> and
> > storing the value 0 or '0' results in the error: > > > > Args required: key => value, hashref_of_properties > > > > Here is some code that replicates the problem: > > ### > > use REST::Neo4p; > > use strict; > > use warnings; > > > > REST::Neo4p->connect('http://127.0.0.1:7474'); > > > > > > my $index = REST::Neo4p::Index->new('node', 'index'); > > > > print "x\n"; > > my $node1 = $index->create_unique(foo => "x", {foo => "x"}); # Works > > > > print "0\n"; > > my $node2 = $index->create_unique(bar => "0", {bar => "0"}); # Doesn't
> work
> > ### > > > > It's likely due to line 211 in Index.pm > > > > unless ($key && $value && $properties && (ref $properties eq 'HASH')) { > > > > Which as $value is 0 it is treated as a boolean false and fails this
> guard
> > code. > > > > Version of Neo4p in use: > > REST::Neo4p > > ------------------------------------------------------------------------- > > CPAN: Module::CoreList loaded ok (v2.96) > > Perl object bindings for a Neo4j database > > M/MA/MAJENSEN/REST-Neo4p-0.2230.tar.gz > > C:\strawberry\perl\site\lib\REST\Neo4p.pm > > Installed: 0.2230 > > CPAN: 0.2230 up to date > > Mark Allen Jensen (MAJENSEN) > > jensen@fortinbras.us > > > > I am finding Neo4j absolutely fantastic to use and your perl library very > > easy and intuitive. > > > > Regards, > > > > Kevin. > >
> > > >
-- *Kevin Pluck* *i**V**endi Limited*