1

SafeCracker gives me a Error after submitting an edit-form…

{exp:safecracker channel='xy' … entry_id='{segment_3}'}
  • The URL contains the entry_id @ segment_3
  • All field-values are included in their respective custom fields
  • If I look into the rendered HTML, the entry_id is all over the place like: <input type="hidden" name="entry_id" value="15771"> and others (RET, URI) … ditto for the correct values for author_id, channel_id, site_id etc. (see below)

If I submit the form, the following error gets displayed.

You must specify a valid entry to edit.

BUT an interesting fact: the entry gets saved anyway!

System: EE 2.5.5

EDIT: All the hiddenFields:

<input type="hidden" name="ACT" value="21">
<input type="hidden" name="RET" value="http://domain.com/dir/dir2/15771">
<input type="hidden" name="URI" value="dir/dir2/15771">
<input type="hidden" name="XID" value="">
<input type="hidden" name="return_url" value="dir/dir2/success/15771">
<input type="hidden" name="author_id" value="1">
<input type="hidden" name="channel_id" value="16">
<input type="hidden" name="entry_id" value="15771">
<input type="hidden" name="site_id" value="1">
<input type="hidden" name="return" value="dir/dir2/success/15771">
<input type="hidden" name="allow_comments" value="y">
2
  • What's the return url of the tag? …........................ Jan 15, 2013 at 8:19
  • I've updated the Question with all the hiddenFields … including return_url
    – albuvee
    Jan 15, 2013 at 8:22

2 Answers 2

2

You write:

The URL contains the entry_id @ segment_3

But

The return url has "success" as segment_3.

<input type="hidden" name="return" value="dir/dir2/success/15771">

This is not a valid entry.

You can either change

 {exp:safecracker channel='xy' … entry_id='{segment_3}'}

to

 {exp:safecracker channel='xy' … entry_id='{segment_4}'}

Or change the url return path to something like

<input type="hidden" name="return" value="dir/dir2/15771/success">
1
  • who had thought that entry_id and return do conflict each other … :-) … thx @okenathan!
    – albuvee
    Jan 15, 2013 at 9:59
0

Are you passing the entry id as ENTRY_ID in the return?

{exp:safecracker channel="channel_name" return="channel_name/edit/ENTRY_ID" entry_id="{segment_3}"}

Your Answer

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

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