[Jifty-commit] r4320 - in jifty/trunk: lib/Jifty/Plugin
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat Oct 27 02:04:46 EDT 2007
Author: sterling
Date: Sat Oct 27 02:04:44 2007
New Revision: 4320
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/AutoReference.pm
Log:
r13668 at dynpc145: andrew | 2007-10-27 01:03:49 -0500
Fixed AutoReference so that it is possible to set the field to empty if not mandatory.
Modified: jifty/trunk/lib/Jifty/Plugin/AutoReference.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/AutoReference.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/AutoReference.pm Sat Oct 27 02:04:44 2007
@@ -56,7 +56,6 @@
);
$collection->unlimit;
- $collection->rows_per_page(20);
if (length $value) {
$collection->limit(
@@ -84,9 +83,16 @@
$collection->columns('id', $brief);
$collection->order_by(column => $brief);
- Jifty->log->info($collection->build_select_query);
-
my @choices;
+ if (!length $value && !$column->mandatory) {
+ $collection->rows_per_page(9);
+ push @choices, { label => _('- none -'), value => '' };
+ }
+
+ else {
+ $collection->rows_per_page(10);
+ }
+
while (my $record = $collection->next) {
push @choices, {
label => $record->brief_description.' [id:'.$record->id.']',
More information about the Jifty-commit
mailing list