1

I recently upgraded to 2.6.1 and I am running into an issue that seems like it could be parse order related, I have the following code that was working before the upgrade.

{if segment_3=="summary"}
     {exp:safecracker channel="jobs"
          return="jobs/application/thanks/ENTRY_ID/{username}/{current_time format="%Y-%g-%d_%H-%i"}" 
          {if segment_4 != "new"}entry_id="{segment_4}"{/if}  
          preserve_checkboxes="yes" 
          include_jquery="yes" 
          safecracker_head="yes" 
          class="safecracker" 
          author_only="yes"}
      {/exp:safecracker}
 {/if}

The global {username} variable is returning the encoded "%7Busername%7D" opposed to actually showing the username. I tested the {username} global variable inside the safecracker loop and outside of it and it works - just is not parsing in the parameters section of safecracker.

Any ideas or thoughts?

1 Answer 1

2

I don't think the {username} global variable is parsed early enough for it to be used within a parameter as you have there.

A couple solutions:

1) You could use Rob Sanchez' Mo' Variables add-on, which adds early parsed member variables.

2) Is the username really necessary within your return URL? Since you are redirecting to the ENTRY_ID, you should be able to pull the username from the author of that entry within the template you're directing to. Within the {exp:channel:entries} tag, the {author} and {author_id} variables are available.

2
  • I am also using profile:edit and was able to use a corresponding field in the members channel created with PE. Thanks for the help Jeremy. Sep 30, 2013 at 16:57
  • That works too! Glad to help. Sep 30, 2013 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.