Re: [Agavi-Dev] [Agavi-Tickets] [Agavi] #1203: Configuration parameter whitespace handling is inconsistent

1 view
Skip to first unread message

David Zülke

unread,
Jan 5, 2010, 1:02:34 PM1/5/10
to d...@lists.agavi.org
Hi folks,

can anyone provide feedback here please?

Thanks,

David


On 05.01.2010, at 18:53, Agavi wrote:

> #1203: Configuration parameter whitespace handling is inconsistent
> --------------------
> +-------------------------------------------------------
> Reporter: david | Owner: david
> Type: defect | Status: new
> Priority: normal | Milestone: 1.0.2
> Component: util | Version: 1.0.1
> Severity: normal | Keywords:
> Has_patch: 0 |
> --------------------
> +-------------------------------------------------------
> Configuration will convert this:
> {{{
> #!xml
> <ae:parameter name="foo"></ae:parameter>
> }}}
> to
> {{{
> NULL
> }}}
> while it converts
> {{{
> #!xml
> <ae:parameter name="foo"> </ae:parameter>
> }}}
> to
> {{{
> string(0) ""
> }}}
>
> This is, in my opinion, confusing and should be fixed. It leads to
> genuinely problematic bugs like #1200. Retaining the space characters
> would still be remotely logical (albeit inconsistent with the
> behavior of
> converting an empty string to {{{NULL}}}), but stripping them and
> leaving
> the empty string is just wrong.
>
> I propose to fix {{{AgaviToolkit::literalize()}}} accordingly, as the
> problem is rooted in that method.
>
> --
> Ticket URL: <http://trac.agavi.org/ticket/1203>
> Agavi <http://www.agavi.org/>
> An MVC Framework for PHP5
>
>
>
> _______________________________________________
> Agavi Tickets Mailing List
> tic...@lists.agavi.org
> http://lists.agavi.org/mailman/listinfo/tickets

Robert Schulze

unread,
Jan 6, 2010, 5:30:50 AM1/6/10
to Agavi Dev Mailing List
Hi there,

Wasn't there an idea of adding a "cast_to" or "type" attribute anyways?
Or check for an explicit CDATA block to preserve leading white-spaces?

So, knowing what type is assumed, casting of " " to NULL may be right when expecting an array, but wrong for strings.

Anyway, a default to NULL (as purposed) seems to be the best way for most cases.

Cheers,
Robert

> _______________________________________________
> Agavi Dev Mailing List
> d...@lists.agavi.org
> http://lists.agavi.org/mailman/listinfo/dev


_______________________________________________
Agavi Dev Mailing List
d...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/dev

Reply all
Reply to author
Forward
0 new messages