return paramater not working for me
Posted: 19 November 2010 03:36 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  10
Joined  2010-08-30

I’m using the following code to allow visitors to submit a prayer request to a church’s website. However, once the request is submitted, the visitor is not taken to the page specified in the return paramater. Instead, they only see a blank white screen with the url remaining on the page they were just on.  This code is used as an embedded template. Any help would be greatly appreciated.

Here is my code:

{exp:safecracker channel="prayer_requests" return="pastoral_care/prayer_submitted"}
    
<label for="title">Your Name</label><br />
    <
input type="text" name="title" id="title" value="{title}" size="50" maxlength="100"><br />

    <
label for="prayer_contact_method">Your Email Address</label><br />
    <
input type="text" name="prayer_contact_method" id="prayer_contact_method" value="{prayer_contact_method}" maxlength="75" size="50" /><br /><br />
    <
label for="prayer_contact">Do you wish to be contacted about your request?</label><br />
    <
select name="prayer_contact" id="prayer_contact" value="{prayer_contact}">
    
{options:prayer_contact}
        
<option value="No"{selected}>No</option>
        <
option value="Yes">Yes</option>
    
{/options:custom_field_name}
    
</select><br /><br />
    <
label for="prayer_share">Would you like your prayer request shared<br />with the DisciplesNet community?</label><br />
    <
select name="prayer_share" id="prayer_share" value="{prayer_share}">
    
{options:prayer_share}
        
<option value="No"{selected}>Noplease keep my prayer request private.</option>
        <
option value="Yes">Yesplease share my prayer request with the community.</option>
    
{/options:custom_field_name}
    
</select><br /><br />

    <
label for="prayer_request">What is your prayer request?<br />
    <
textarea id="prayer_request" name="prayer_request" value="{prayer_request}" cols="70" rows="15"></textarea>
    <
br />
    <
input type="submit" name="submit" value="Submit" />

{/exp:safecracker} 

Here is my EE info

EE Info
ExpressionEngine   2.1.1 Build 20101020
MSM   not installed
Extensions   installed
jQuery   1.4.2
MySQL   5.0.91-community-log
Server   Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5 mod_fcgid/2.3.5 Phusion_Passenger/2.2.15 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635


PHP Info
version   5.2.14
register_globals   off
safe_mode   off
max_execution_time   300
upload_max_filesize   10M
max_input_time   60
memory_limit   64M
session_save_path   writable

Add-Ons
Modules
Blacklist 3.0
Blogger Api 2.0
Comment 2.1
Email 2.0
Emoticon 2.0
Ip To Nation 2.2
Jquery 1.0
Mailinglist 3.0
Friends 1.5.0
Moblog 3.0
Pages 2.0
Query 2.0
Rss 2.0
Referrer 2.0
Search 2.0
Simple Commerce 2.0
Updated Sites 2.0
Wiki 2.1
Channel 2.0.1
Member 2.0
Stats 2.0
User 3.2.3
Navee 1.2.5
Mountee 1.0
Safecracker 1.0.0
Freeform 3.0.3
Iexpression 1.4
Code Pack 1.1.0

Extensions
User 3.2.3
Mx Title Control 2.0.4
First Timer 2.0.1
Cp Analytics 1.0.1
Safecracker 1.0.0
Sc Publish Redirect 1.0.1
Friends Code Pack 1.1.0

Accessories
Cp Analytics 1.0
Template Variables 1.1
Health Check 0.1.0

Field Types
select 1.0
text 1.0
textarea 1.0
date 1.0
file 1.0
multi_select 1.0
checkboxes 1.0
radio 1.0
rel 1.0
bbr_ckeditor 1.0.2
safecracker_catchall 1.0.0
safecracker_file 1.0.0

Profile
 
 
Posted: 19 November 2010 03:37 AM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

If you check in the CP, is the entry being saved/created properly? As in, only the redirect is not working?

Profile
 
 
Posted: 19 November 2010 03:39 AM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  10
Joined  2010-08-30

Yes, the entry is being saved properly and displaying in the proper places I have it displaying.  It seems the only issue is the redirect.

Profile
 
 
Posted: 19 November 2010 03:40 AM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’m willing to bet it’s a conflict with SC Publish Redirect.

Profile
 
 
Posted: 19 November 2010 03:42 AM   [ Ignore ]   [ # 4 ]
Wallflower
Rank
Total Posts:  10
Joined  2010-08-30

Forgive my noobness, but is there anything I can do if that’s the case?

BTW, thanks for the fast reply

Profile
 
 
Posted: 19 November 2010 03:46 AM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  10
Joined  2010-08-30

Okay, so maybe this wasn’t smart (cuz I don’t know what I’m doing), but I went into the safecracker_lib.php file and removed

$return $this->EE->api_sc_channel_entries->trigger_hook('entry_submission_redirect'$return); 

from somewhere around line 1235.

It seemed to work.  Is this going to come back and haunt me?

Profile
 
 
Posted: 19 November 2010 03:48 AM   [ Ignore ]   [ # 6 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Try replacing it with this, instead of removing it:

if ($hook_return $this->EE->api_sc_channel_entries->trigger_hook('entry_submission_redirect'$return))
{
    $return 
$hook_return;
Profile
 
 
Posted: 19 November 2010 03:50 AM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  10
Joined  2010-08-30

Thanks.  That worked like a charm.

Profile