Skip Menu |

This queue is for tickets about the perl-ldap CPAN distribution.

Report information
The Basics
Id: 77674
Status: rejected
Priority: 0/
Queue: perl-ldap

People
Owner: Nobody in particular
Requestors: THEREVMJ [...] cpan.org
Cc:
AdminCc:

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



Subject: Net::LDAP::Entry::delete/replace misbehaving?
In Net::LDAP::Entry, it appears that either the delete and replace functions are misbehaving or the new and add functions is misbehaving. If you create a new object and specify an attribute with an empty array as it's values, the object contains a has a a hash entry for the attribute that points to and empty array: $ perl -MNet::LDAP::Entry -e 'my $e = Net::LDAP::Entry->new( "dc=com", foo => [] ); print $e- Show quoted text
>dump;'
------------------------------------------------------------------------ dn:dc=com foo: The same occurs if you 'add' an attribute with an empty array as it's value: $ perl -MNet::LDAP::Entry -e 'my $e = Net::LDAP::Entry->new; $e->add( foo => [] ); print $e- Show quoted text
>dump;'
------------------------------------------------------------------------ foo: However, if your entry contains an attribute, and you delete the final value of the attribute, the object no longer contains any reference to the attribute at all: $ perl -MNet::LDAP::Entry -e 'my $e = Net::LDAP::Entry->new( "dc=com", foo => [ 1 ] ); $e- Show quoted text
>delete( foo => 1 ); prinnt $e->dump;'
------------------------------------------------------------------------ dn:dc=com And the same occurs if you replace an existing attribute with an empty array: perl -MNet::LDAP::Entry -e 'my $e = Net::LDAP::Entry->new( "dc=com", foo => [ 1 ] ); $e- Show quoted text
>replace( foo => [] ); print $e->dump;'
------------------------------------------------------------------------ dn:dc=com This behavior is problematic if you load and entry, make changes to it (such as deleting the final value), and the do an update on the entry. Because the attribute is no longer associated with the object, the atribute is not modified on the server. The workaround I am currently using is to follow every 'delete' and 'replace' on an attribute with an 'add' that specifies an empty array as a value. If this is in fact the intended behavior, then it would be nice if it was clarified in the documentation. Thanks!
Subject: Re: [rt.cpan.org #77674] Net::LDAP::Entry::delete/replace misbehaving?
Date: Wed, 6 Jun 2012 19:46:52 -0500
To: bug-perl-ldap [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
On Jun 6, 2012, at 14:19 , Michael Johnson via RT wrote: Show quoted text
> > This behavior is problematic if you load and entry, make changes to it (such as deleting the > final value), and the do an update on the entry. Because the attribute is no longer associated > with the object, the atribute is not modified on the server. The workaround I am currently > using is to follow every 'delete' and 'replace' on an attribute with an 'add' that specifies an > empty array as a value.
Can you describe the exact use you are using and the problem. The fact that ->dump does not show the attribute is meaningless. All add/replace/delete command modify the local data but also get stored in a local command queue which is used when an update to the server is done. So, how exactly are you using this and what results are you seeing that you are not expecting. Graham.
Hi Michael, On Wed Jun 06 20:47:05 2012, gbarr@pobox.com wrote: Show quoted text
> On Jun 6, 2012, at 14:19 , Michael Johnson via RT wrote:
> > > > This behavior is problematic if you load and entry, make changes to
> it (such as deleting the
> > final value), and the do an update on the entry. Because the
> attribute is no longer associated
> > with the object, the atribute is not modified on the server. The
> workaround I am currently
> > using is to follow every 'delete' and 'replace' on an attribute with
> an 'add' that specifies an
> > empty array as a value.
> > Can you describe the exact use you are using and the problem. The fact > that ->dump does not show > the attribute is meaningless. All add/replace/delete command modify > the local data but also get stored > in a local command queue which is used when an update to the server is > done. > > So, how exactly are you using this and what results are you seeing > that you are not expecting.
Ping? Any updates? Peter
No details to the alleged bug within 3 months (with 2 requests) =>