Skip Menu |

This queue is for tickets about the DBIx-Class-ResultSet-RecursiveUpdate CPAN distribution.

Report information
The Basics
Id: 67528
Status: resolved
Priority: 0/
Queue: DBIx-Class-ResultSet-RecursiveUpdate

People
Owner: Nobody in particular
Requestors: develop [...] altersign.com
Cc:
AdminCc:

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



Subject: optional foreign key can't be updated to NULL
Date: Sun, 17 Apr 2011 06:42:57 +0300
To: bug-DBIx-Class-ResultSet-RecursiveUpdate [...] rt.cpan.org
From: Yaroslav Polyakov <develop [...] altersign.com>
Hi, I found that recursive update of optional foreign key is not working as expected from the documentation: http://search.cpan.org/~abraxxa/DBIx-Class-ResultSet-RecursiveUpdate-0.23/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm#Treatment_of_belongs_to_relations It's impossible to update the foreign key to NULL. I attach a patch that fixes this issue. Distribution: DBIx-Class-ResultSet-RecursiveUpdate-0.23 Show quoted text
> perl -v
This is perl 5, version 12, subversion 2 (v5.12.2) built for i386-freebsd-64int Show quoted text
> uname -a
FreeBSD ccc 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 Thank you for your attention. -- Best regards, Yaroslav mailto:develop@altersign.com

Message body is not shown because sender requested not to inline it.

Please always provide a failing test case before suggesting a fix that shows the problem. Without it I can't verify the problem and a future refactor could reintroduce it without being noticed.
Subject: [rt.cpan.org #67528] optional foreign key can't be updated to NULL
Date: Sun, 17 Apr 2011 23:58:23 +0300
To: Alexander Hartmaier <bug-DBIx-Class-ResultSet-RecursiveUpdate [...] rt.cpan.org>
From: Yaroslav Polyakov <develop [...] altersign.com>
Hi Alexander, thanks for advice. I attached an archive with test db sql, sqlite database, db schema classes and test script (test.pl). As you can see in test.output, current version of recursive_update doesn't set foreign key to NULL, when it requested. Will be glad to provide any additional information. -- Best Regards, Yaroslav.
Download test.zip
application/x-zip-compressed 4.1k

Message body not shown because it is not plain text.

From: colm.ennis [...] gmail.com
Hi, I came across the same bug and bug fix myself. The update works from my tests. Colm
Fixed in 0.31. Sorry for the delay.