Recent Topics

1 Apr 22, 2009 11:59    

In 2.4.6 but also in 3.x the fields rss2_redirect and atom_redirect inside the advanced blog settings are limited needlessly to 50 characters. I realized that when trying to input my brand new feedburner URL:

http://feed.liberal-venezolano.net/ElLiberalVenezolano

Which has 54 characters :)

The culprit is in inc/collections/views/_coll_advanced.form.php around line 86, which passes a field size of 50 to $Form->textinput and this in turn uses the field size as default maxlength for the field.

Inspecting the database, the cset_value column of evo_coll_settings has a maximum length of 255 chars, so the 50 chars limitation here is not needed.

Here is a patch against 2.4.6 sources:

--- evodev/inc/collections/views/_coll_advanced.form.php	2009-04-22 11:40:36.000000000 +0200
+++ blog/inc/collections/views/_coll_advanced.form.php	2009-01-25 19:15:40.000000000 +0100
@@ -85,9 +85,9 @@
 
 $Form->begin_fieldset( T_('External Feeds').get_manual_link('external_feeds') );
 	$Form->text_input( 'atom_redirect', $edited_Blog->get_setting( 'atom_redirect' ), 50, T_('Atom Feed URL'),
-											T_('Example: Your Feedburner Atom URL'), array('maxlength' => 255));
+											T_('Example: Your Feedburner Atom URL'));
 	$Form->text_input( 'rss2_redirect', $edited_Blog->get_setting( 'rss2_redirect' ), 50, T_('RSS2 Feed URL'),
-											T_('Example: Your Feedburner RSS2 URL'), array('maxlength' => 255) );
+											T_('Example: Your Feedburner RSS2 URL'));
 $Form->end_fieldset();

If the patch is reversed, I'm sorry, I always forget which one goes first :( In any case you can see the fix is trivial.

EDIT: Oh my, when will I learn! The correct patch (not reversed) is this:

--- blog/inc/collections/views/_coll_advanced.form.php	2009-01-25 19:15:40.000000000 +0100
+++ evodev/inc/collections/views/_coll_advanced.form.php	2009-04-22 11:40:36.000000000 +0200
@@ -85,9 +85,9 @@
 
 $Form->begin_fieldset( T_('External Feeds').get_manual_link('external_feeds') );
 	$Form->text_input( 'atom_redirect', $edited_Blog->get_setting( 'atom_redirect' ), 50, T_('Atom Feed URL'),
-											T_('Example: Your Feedburner Atom URL'));
+											T_('Example: Your Feedburner Atom URL'), array('maxlength' => 255));
 	$Form->text_input( 'rss2_redirect', $edited_Blog->get_setting( 'rss2_redirect' ), 50, T_('RSS2 Feed URL'),
-											T_('Example: Your Feedburner RSS2 URL'));
+											T_('Example: Your Feedburner RSS2 URL'), array('maxlength' => 255) );
 $Form->end_fieldset();
 

2 May 02, 2009 22:21

Thanks for the patch.

3 May 05, 2009 16:02

I've applied it to the trunk some days ago.


Form is loading...