6

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
  • 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. Commented Sep 29, 2014 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. Commented Sep 30, 2014 at 8:32

3 Answers 3

10

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>
6

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() %}
1

I run into the same issue and I found out, that the problem was with one of the fields I have added into the Entry Type.

The field was not required, but it had set Min Relations to 1. Craft was testing the Min Relations on the save and since I was not using this field in the Entry Form at all, I didn't get the error message.

Your Answer

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

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