5

I am trying to make entries editable from the front end and pretty much follwed the docs.

When i visit my edit view, the entry-from is filled with their respective values but unfortunately no changes are being saved back when i update those and submit. A redirect is also not happening. The old form just loads again.

Not errors too. The site is localized so could this be a problem? Should i add the locale to my inputs?

  • 2
    Your entry is likely failing due to a missing required field, incorrect formatting, or other not-critical error. Have a look at the answer to this post. – Douglas McDonald Sep 29 '14 at 16:14
  • Thanks Douglas. Had a look into most of them. There are no required fields. Interestingly enough, updating an entry now works, just like that. With the exception of assets. Assets for new entries are working fine but updating an existing asset results in the deletion but not updating to the new one. It doesn’t get uploaded either. However, the redirect works. Investigating. – Marcus Scheller Sep 30 '14 at 8:32
7

I've run into this situation in various scenarios as well where a front-end entry form fails to save anything and just seems to be reloading the page. Almost always it has had to do with overlooking a required field or some other small detail, as Douglas mentions in his comment.

If all of your fields are not required, make sure you are still setting fields like the Title field, which are necessary for your Entry to save properly.

One way to help troubleshoot is to take a look at all of the errors you are getting back. If you are just trying to output errors for the fields you are submitting you may be missing seeing an error for another field that is giving you an error but that you are not outputting.

When a front-end entry form fails to submit, Craft will add any errors to the EntryModel and return it to the page. If you have devMode enabled, you can dump all of the errors from your submission with the following line of code to help troubleshoot:

<pre>{{ dump(entry.getErrors()) }}</pre>
5

The possible reason for no errors being shown is that you re-define your entry variable before displaying the errors. Make sure you have

{% if entry is not defined %}
    {% set entry = craft.entries.id(craft.request.segment(4)).first() %}
{% endif %}

and not just

{% set entry = craft.entries.id(craft.request.segment(4)).first() %}

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.