Hello again!
I ran into an issue where I just can't figure out whats wrong with it, so it's kinda hard to give it a proper title. Maybe too many (although not really) redirects and IFs, but I'm just not sure.
Problem is, after the custom route takes effect (all is working there) I end up with an empty page, only when I refresh the page everything is as it should be.
The thing is part of a survey. In the add_view I ask for the initial information to create a page, and then redirect to the edit_view via the last entered ID. From there on I use an internal count (editable region) to indicate on which step on is within the survey, and display different forms accordingly. The latter all works fine, just not between the redirect of the add_view to the first load of the edit_view.
These are my defined routes and how those are then matched:
And this is in short what the form/submit looks like in the add_view where I redirect afterwards to the edit_view to continue with the survey:
What am I missing/doing wrong here? Some help would be highly appreciated!
I hope the information is sufficient. I'm of course happy to give all the information again and could provide the link to the live version if that is needed.
I ran into an issue where I just can't figure out whats wrong with it, so it's kinda hard to give it a proper title. Maybe too many (although not really) redirects and IFs, but I'm just not sure.
Problem is, after the custom route takes effect (all is working there) I end up with an empty page, only when I refresh the page everything is as it should be.
The thing is part of a survey. In the add_view I ask for the initial information to create a page, and then redirect to the edit_view via the last entered ID. From there on I use an internal count (editable region) to indicate on which step on is within the survey, and display different forms accordingly. The latter all works fine, just not between the redirect of the add_view to the first load of the edit_view.
These are my defined routes and how those are then matched:
- Code: Select all
<cms:route
name='add_view'
path='add{:slash}'
filters=''
>
<cms:route_constraints
slash='(\/?)'
/>
</cms:route>
<cms:route
name='edit_view'
path='edit/{:ticket_id}/{:id}'
filters='page_exists=id'
>
<cms:route_constraints
slash='(\/?)'
/>
<cms:route_validators
ticket_id='title_ready | exact_len=15'
id='non_zero_integer'
/>
</cms:route>
- Code: Select all
<cms:else_if k_matched_route='add_view'/>
<cms:if has_ticket>
<cms:embed "survey_step0.html" />
<cms:else/>
log in with ticket or create account
</cms:if>
<cms:else_if k_matched_route='edit_view'/>
<cms:pages id=rt_id>
<cms:related_pages 'ccdb_supplier' ><cms:set ticket_supplier=supdb_ticket 'global'/></cms:related_pages>
<cms:if rt_ticket_id=ticket_supplier>
<cms:embed "survey_step<cms:show ccdb_survey_step/>.html" />
<cms:else/>
No way, Hosay!
</cms:if>
</cms:pages>
And this is in short what the form/submit looks like in the add_view where I redirect afterwards to the edit_view to continue with the survey:
- Code: Select all
<cms:form
masterpage='template-name.php'
mode='create'
enctype='multipart/form-data'
method='post'
anchor='0'
>
<cms:if k_success >
[...]
<cms:db_persist_form
_invalidate_cache='0'
_auto_title='1'
[...]
ccdb_survey_step='2'
[...]
/>
<cms:if "<cms:not k_persist_error />">
<cms:redirect url="<cms:route_link 'edit_view' masterpage='template-name.php' rt_ticket_id=supplier_ticket rt_id=k_last_insert_id />" />
</cms:if>
</cms:if>
<cms:if k_error >
<div class="error">
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
[- here are inputs -]
</cms:form>
What am I missing/doing wrong here? Some help would be highly appreciated!
I hope the information is sufficient. I'm of course happy to give all the information again and could provide the link to the live version if that is needed.