1 of 2
1
SC edit problem
Posted: 23 October 2010 12:23 AM   [ Ignore ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

EE build 20101020
SC build 20101019

I have a SC form setup to change allow_comments for an entry, but when I submit the form it’s asking for values for the other fields associated with the entry. Not sure if this is a SC or an EE latest build issue.

What do you think Rob?

Profile
 
 
Posted: 23 October 2010 12:25 AM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I may have broken something in the last build, let me check.

Profile
 
 
Posted: 23 October 2010 02:29 AM   [ Ignore ]   [ # 2 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Are those other fields marked as required?

Profile
 
 
Posted: 23 October 2010 02:31 AM   [ Ignore ]   [ # 3 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Yes they are.

Profile
 
 
Posted: 23 October 2010 02:34 AM   [ Ignore ]   [ # 4 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

That’s the issue. With the new form validation from the last build, it checks for required fields. So you should probably mark those as not required. If that’s a problem for you, let me know, and I’ll try and think of something else.

Profile
 
 
Posted: 23 October 2010 02:45 AM   [ Ignore ]   [ # 5 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

So you should probably mark those as not required. If thatâ??s a problem for you, let me know, and Iâ??ll try and think of something else.

Hate to say it, but it is a problem and I’d be surprised if it isn’t for others as well. If I mark them as not required they can be skipped on the input form - right?

What’s the new form validation from the last build all about, can’t find any mention in the docs?

Profile
 
 
Posted: 23 October 2010 02:57 AM   [ Ignore ]   [ # 6 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Take a look at: http://barrettnewton.com/safecracker/user_guide/entry_form/#par_rules and http://barrettnewton.com/safecracker/user_guide/entry_form/#par_error_handling

Basically, I changed the underlying architecture to use CodeIgniter’s form validation class, which gives us more flexibility for displaying errors and creating validation rules for fields.

It was my intent to not change the behavior of the entry form, so that no one would notice, but that’s clearly not the case :(

I’m thinking of adding a not_required=”” param that lets you override the stated field requirements, do you think that would be fix enough for you? So in your allow comments form, you could have:

{exp:safecracker channel="x" not_required="field_a|field_b"

I could also maybe do a field_validation=“off” parameter, but I’m not sure yet how much work that would be on my end.

Profile
 
 
Posted: 23 October 2010 03:06 AM   [ Ignore ]   [ # 7 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Thanks for the links, validation looks really good - I’ll give it a try out over the weekend.

Iâ??m thinking of adding a not_required=â?â? param that lets you override the stated field requirements, do you think that would be fix enough for you?

So this would work on the entry and edit forms? And any data already entered in a field would not be trashed if an edit form didn’t resubmit it, if you follow me?

Hope you didn’t mind me putting SC up for sale ($10000) in the EE forums smile

Profile
 
 
Posted: 23 October 2010 03:36 AM   [ Ignore ]   [ # 8 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29
Lee - 23 October 2010 03:06 AM

So this would work on the entry and edit forms? And any data already entered in a field would not be trashed if an edit form didn’t resubmit it, if you follow me?

Correct.

Hope you didn’t mind me putting SC up for sale ($10000) in the EE forums smile

A little cheap, don’t you think wink

Profile
 
 
Posted: 23 October 2010 03:54 AM   [ Ignore ]   [ # 9 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Iâ??m thinking of adding a not_required=â?â? param that lets you override the stated field requirements, do you think that would be fix enough for you?

Sound’s like a plan then, unless you can make the edit form just submit and save what it’s being told to do, without even thinking about the other fields.

Profile
 
 
Posted: 23 October 2010 05:13 PM   [ Ignore ]   [ # 10 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Been thinking about this solution; while it’s OK for forms that just have a few fields, it would be a real pain in the ass for forms with 40 of 50 fields.

Profile
 
 
Posted: 23 October 2010 07:47 PM   [ Ignore ]   [ # 11 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’ll experiment with a few things, I’ll let you know how it goes.

Profile
 
 
Posted: 26 October 2010 01:59 AM   [ Ignore ]   [ # 12 ]
Wallflower
Rank
Total Posts:  7
Joined  2010-10-17

Just wanted to reply that the new build with the required fields was a big change here.
We had a couple of SafeCracker forms that were just submitting a changed status or an edited description and had to add back in the other required fields like date and file even though they’re not being used/edited.

Looking forward to what you come up with Rob, thanks!

Profile
 
 
Posted: 26 October 2010 03:37 AM   [ Ignore ]   [ # 13 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’m truly sorry about this, guys. This was a major under-the-hood change, and there have been hiccups. I’m working on a fix that will preserve your original values if the field is not present in the form. Hopefully it’ll be out tomorrow.

Profile
 
 
Posted: 26 October 2010 06:08 AM   [ Ignore ]   [ # 14 ]
Wallflower
Rank
Total Posts:  1
Joined  2010-10-26

Good evening.

I have the same problem.  However, I used the following :

<input name="status" type="hidden" value="closed"/> 

And added the rest of my fields in a display:none DIV.  Should be OK in the meantime !

 Signature 

————————————————————-
David Rousseau
http://www.davidrousseau.com/

Profile
 
 
Posted: 27 October 2010 03:00 AM   [ Ignore ]   [ # 15 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Hi guys—I just put out a new build today that preserves fields that are not explicitly in the form. Please check this special note about checkboxes, though: http://barrettnewton.com/safecracker/user_guide/entry_form/#par_preserve_checkboxes

Let us know if you have any issues.

Profile
 
 
   
1 of 2
1