I'm working with Stash's wrapper and partial templates. In one of my partials I've put a Safecracker-form inside a {exp:stash:set} tag. Further down that partial-template I {exp:stash:get} that form inside another "main content" {exp:stash:set}.

The form shows okay on frontend, but when I submit it I get 2 PHP-errors, and all of the form variables and values are appended to the URL.

When I put the form in the wrapper template, everything works fine.

It must be something I'm doing wrong since I'm quite new to Stash.. what can it be? The channel has no versioning btw.

The PHP-errors:

**A PHP Error was encountered**
Severity: Notice
Message: Undefined index: enable_versioning
Filename: libraries/Safecracker_lib.php
Line Number: 1378

**A PHP Error was encountered**
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Volumes/Webdev/domains/site.nl/system/codeigniter/system/core/Exceptions.php:170)
Filename: libraries/Functions.php
Line Number: 405

Partial Template:


{exp:stash:set name="form"}

    {!-- this is normally on one line --}
    {exp:safecracker channel="someform" 
        <div class="form-group">All my form fields go here</div>
        <div class="form-group">They is happy form fields</div>

{!-- the main_content var which has a "get" in the wrapper template --}
{exp:stash:set name="main_content" }
<div id="secondary" class="section-secondary section">
    <form class="form-horizontal">
            <legend>Request Form</legend>

            <div class="form-groups-container">         
                {exp:stash:get name="form"}


-- UPDATE --
When I comment-out the versioning-stuff in Safecracker_lib.php, the form submits to a blank page, no errors whatsoever. And all the form vars en values are in the URL, ie;


Have tried several things with {stash:nocache} and all kinds of tags (process="end", parse_tags="yes" parse_depth="2") but obviously that's just random testing stuff out..

  • Just a tip - the second is simply triggered by the first (you almost always see that error whenever other PHP errors appear), so the Safecracker_lib.php error is the one to research. Mar 26, 2013 at 9:59
  • Thank you for clearing this, will investigate that one some more.
    – Sjoerd
    Mar 26, 2013 at 10:01
  • Commented out the Safecracker versioning stuff, didnt do much except now the form submits to a blank page as stated above. Weirdness.
    – Sjoerd
    Mar 26, 2013 at 14:00
  • Does the safecracker form work fine for you if it's not inside Stash? Mar 26, 2013 at 18:29
  • Stash can certainly change expected behaviour, especially with things like dynamic form submissions. As Adrian mentioned, I'd test without Stash to see if it works fine first. Using the 'template partials' approach with Stash (whilst very cool and very good for performance and maintenance) does go off the roster a little and is harder to get support with.
    – Ian Young
    Mar 26, 2013 at 19:06


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.