[Agavi-Tickets] [Agavi] #1461: Guarantee order of form population and give preferential treatment to automatically re-populated forms

1 view
Skip to first unread message

Agavi

unread,
Dec 11, 2011, 1:58:55 PM12/11/11
to tic...@lists.agavi.org
#1461: Guarantee order of form population and give preferential treatment to
automatically re-populated forms
--------------------+-------------------------------------------------------
Reporter: david | Owner: david
Type: task | Status: new
Priority: normal | Milestone: 1.0.7
Component: filter | Version: 1.0.6
Severity: normal | Keywords:
Has_patch: 0 |
--------------------+-------------------------------------------------------
Right now, if you have two forms in the document like this:

{{{
#!text/html
<form id="search" action="/search"><input type="text" name="q" /><input
type="submit" value="Search" />
<form id="blah" action="/blah/15/burp"><input type="text" name="yay"
/><input type="submit" value="Save" />
}}}

And you want, in BlahBurpErrorView, to re-populate form "blah", but also
pre-populate form "search" for user's convenience like so:
{{{
#!php
<?php
$rq->setAttribute(
'populate',
array(
'search' => new AgaviParameterHolder(array('q' => 'laser beams')),
'blah' => true,
),
'org.agavi.filter.FormPopulationFilter'
);
}}}

then any error on the "blah" form will be populated onto form "search",
even if you change the order in the "populate" array so "blah" is listed
first.

The reason for this is that the XPath node set does not have any
guaranteed order, so the code needs to be changed so it fetches each form
separately to preserve the order.

But for that to be any useful, we need to put keys with a value of
{{{true}}} into the first position, so they're always populated before
others regardless of their position in the "populate" array, since it's
unlikely that the other forms need any error messages inserted on them.
Saves users from big "WTF" moments.

--
Ticket URL: <http://trac.agavi.org/ticket/1461>
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

Agavi

unread,
Dec 11, 2011, 3:43:00 PM12/11/11
to tic...@lists.agavi.org
#1461: Guarantee order of form population and give preferential treatment to
automatically re-populated forms
--------------------+-------------------------------------------------------
Reporter: david | Owner: david
Type: task | Status: closed

Priority: normal | Milestone: 1.0.7
Component: filter | Version: 1.0.6
Severity: normal | Resolution: fixed
Keywords: | Has_patch: 0
--------------------+-------------------------------------------------------
Changes (by david):

* status: new => closed
* resolution: => fixed


Comment:

(In [4886]) Guarantee order of form population and give preferential
treatment to automatically re-populated forms, closes #1461

--
Ticket URL: <http://trac.agavi.org/ticket/1461#comment:1>

Reply all
Reply to author
Forward
0 new messages