[Catalyst] HTML::Prototype path for array of strings

Dobrica Pavlinusic dpavlin at rot13.org
Sun Nov 27 23:46:55 CET 2005


It seems that this feature was replaced with more advanced support for
hash arrays. Attached patch add check to be backward compatible.

-- 
Dobrica Pavlinusic               2share!2flame            dpavlin at rot13.org
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin
-------------- next part --------------
==== Patch <html-prototype-autocomplete-array> level 1
Source: [No source]
Target: 4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/HTML-Prototype/lib/HTML:2209
        (http://dev.catalyst.perl.org/repos/Catalyst/trunk)
Log:
Rectore backwards compatible way of calling with array of strings
=== Prototype.pm
==================================================================
--- Prototype.pm  (revision 2209)
+++ Prototype.pm  (patch html-prototype-autocomplete-array level 1)
@@ -275,8 +275,13 @@
     my ( $self, $entries, $field, $phrase ) = @_;
     my @elements;
     for my $entry ( @{$entries} ) {
-        my $e = $entry->{$field};
-        my $item = $phrase ? _highlight( $e, $phrase ) : $e;
+    	my $item;
+    	if (ref($entry) eq 'HASH') {
+		my $e = $entry->{$field};
+		$item = $phrase ? _highlight( $e, $phrase ) : $e;
+	} else {
+		$item = $entry;
+	}
         push @elements, HTML::Element->new('li')->push_content($item);
     }
     return HTML::Element->new('ul')->push_content( _unique(@elements) )

==== BEGIN SVK PATCH BLOCK ====
Version: svk 0.991 (linux)

eJxVUt1u0zAUrsTVJu0djORpmyA0sZMm6URWLkBD/GhiA3FXufFJY81NguNuVPMktrs9FC8AL4Xt
0AkiJdY538/xOTlv1MXxLDJFERocheb8y7vp9Izpst63EZ4Y4EK3CidGwhVITI1slzg2DVuBRTVT
S9BFEVlxNohfe8HWJHYeC6bbpse5N5trBYAjQ2bUzIixXxtEFmw7aOaqbbUtFkWExhaduzuVsu1h
7rSOnzg+2fIrIa0ZMWeq1a3edPCiW3m/rQd1HslfDy4UlPZ2G0cZzDzKuk5u5hq+aw5SM1+AEpMD
zxdpGtMqYjkteVoCj6ssi/KQAKlK27Nr+uNodP/w5P7h7d7d09Gvs9EPe9z9/Pr72c5qg7DQsDre
20X22REVOlRQHWJotNocIfiGDk5fnZ8eHKGbvd0dzwf0Eg14UNzgSoDkt8cO9E4O7GrFekAnaF6L
ZS3tqw+t5PkjcoSmNnaiWwTSJm7+03tzj87ifyc8zHJoPc2yihOACYeITfIstb2zKqQkJ2kU5szP
eJKYT36egBasvLxmiveobFcd02IhAV2zDWorVDIpRbNE10LXiCk1ZHutbLLHlJpar2TQbf9gwNa6
dS4StA0cvyiIwYQMC3bhd246/dyIK1A9k/sTYzfSFq3teiq4ssF6LTimoRlrtW4ux6cXH94Hjysy
lmLhU5ZISJhjOjEx4zQtOQmSCsogpFEYZDSpggVNs6RMCaNp/Ael/wJi
==== END SVK PATCH BLOCK ====


More information about the Catalyst mailing list