Looks like I've struck another bug with Raven.

The Setup

I have Raven form and success in separate partials because I want to reuse raven forms for several forms on the same page. I'm passing id variable to the form so I can get proper success/error messages.

The Files

Contact.html looks like this:

    {{ theme:partial src="raven-info-modal" form-id="whwew" }}
    {{ theme:partial src="raven-form" form-id="whwew" }}

Raven-info-modal partial looks like this:

{{ if {raven:has_errors id="{form-id}"} }}

  <h3>form-id= {{form-id}} </h3>

  <h2>Aww, sorry but you did it wrong:</h2>

  <ul>
  {{ raven:errors id="{form-id}"}}
    {{ missing }}
      <li>{{ field }}: {{ message }}</li>
    {{ /missing }}

    {{ invalid }}
      <li>{{ field }}: {{ message }}</li>
    {{ /invalid }}

  {{ /raven:errors }}
  </ul>
{{ endif}}

{{ if {raven:success id="{form-id}"} }}
   <h3>form-id= {{form-id}} </h3>
    <h1>Good job, son!</h1>

{{ endif }}

And raven-form looks simply like this:

         {{ raven:form formset="contact" id="{form-id}" }}

          <h3>form-id= {{form-id}} << this shouldn't be empty!</h3>

          <label for="name">Your humble name</label>
          <input type="text" name="name" value="" /><br>

          <label for="email">Your electronic mail address</label>
          <input type="email" name="email" value="" /><br>

          <label for="website">Your website</label>
          <input type="text" name="website" value="" /><br>

          <label for="years">Years you too have been stranded</label>
          <input type="text" name="years" value="" /><br>

          <label for="years">Checked?</label>
          <input type="checkbox" name="checked" /><br>

          <input type="submit" value="Submit" />

        {{ /raven:form }}

As you see I'm trying to pass form id to the partials. It seems to work correctly with raven-info-modal partial but not with raven-form. However the success and error message are displayed correctly.

Now comes the tricky part:

I switched to static error/success pages in raven-form.html:

        {{ raven:form 
           formset="contact" 
           attr="class:contact" 
               return: form-success
               error_return: form-error
           id="{form-id}"
        }}

Now success and error return don't work anymore, the page just refreshes like in the previously reported bug.

Hope you can squash this one as fast as the first one, Jack.

Thanks!

Answered by Jason Varga! Go to answer.