History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RIFE-316
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Geert Bevin
Reporter: Maxim Grigoriev
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
RIFE

Pathinfo inputs aren't preserved in the URL during behavioral inheritance

Created: 24/Nov/06 04:13 PM   Updated: 04/Aug/07 01:34 AM
Component/s: engine
Affects Version/s: 1.5.1
Fix Version/s: 1.6.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Scale: Bite-sized


 Description  « Hide
Element:

<element id="AUTH" extends="rife/authenticated/mixed.xml">...</element>

<element id="ContestEntryAdd"
             implementation="com.frnews.web.rife.element.contest.entry.ContestEntryAdd"
             url="/contest/add/*" pathinfo="strict" inherits="AUTH">
        <pathinfo mapping="$contestItemId"/>
....
</element>

When there's no logined user, this element shows login form.

Template:

<form name="credentials" action="[!V 'SUBMISSION:FORM:credentials'/]"
                  method="post">
...
</form>

The wrong behavior is next.
I come to URL: http://localhost:8080/contest/add/1
And login form is shown:
<form name="credentials" action="/contest/add" method="post">

It has wrong action url "/contest/add" but it should be "/contest/add/1"
And after submit i see 404 because there're no elements by "/contest/add" url.

 All   Comments   Work Log   Change History      Sort Order:
Joshua Hansen [06/Jun/07 07:05 AM]
I suspect the "guilty" line is in ElementContext.java:
------
...
// only substitute the template value if it hasn't been specified yet
// this allows for user overriding
if (!template.isValueSet(submission_form_value_id))
{
template.setValue(submission_form_value_id, getSubmissionFormUrl(null).encoder(encoder));
set_values.add(submission_form_value_id);
}
...
-----

ElementContext.getSubmissionFormUrl(String pathinfo) needs the pathinfo in order to be able to tack it onto the submission. It is currently hard coded to null instead of passing something appropriate (something from ElementInfo?). There may be other problems, but this line of code is probably involved. :)

Possible solution: Can we use the raw request url? Perhaps we would still need to filter GET parameters...

Reference url for code (ElementContext.java rev=3738):
http://rifers.org:8088/fisheye/browse/~raw,r=3738/rifers/rife/trunk/src/framework/com/uwyn/rife/engine/ElementContext.java

Joshua Hansen [06/Jun/07 07:10 AM]
I should have mentioned that I ran into this also. :) Maxim's description is accurate.