Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for issue #25 #73

Merged
merged 1 commit into from
Aug 6, 2014
Merged

Proposed fix for issue #25 #73

merged 1 commit into from
Aug 6, 2014

Conversation

UndefinedOffset
Copy link
Contributor

I've been running into checkboxes not saving with a project (issue #25), this is the best way I can think of to resolve it short of a major re-think of how the WidgetEditorArea works. The only other thing I can think of is to iterate the fields rather than the data submitted and do the work-around there.

@wilr
Copy link
Member

wilr commented Jul 1, 2014

Hey, obviously no one else is going to look into this so can do :) Do you know the reason why Checkboxs aren't in the $data array? Ideally custom stuff like populateFromPostData() should be as nice as $this->update($data) and let the ORM do it's thing.

My worry with this patch is a checkbox which is set to true, not in the cms (or hidden for some reason) is now going to default to false causing more confusing issues.

@UndefinedOffset
Copy link
Contributor Author

$data is derived in this case straight from $_REQUEST https://github.com/silverstripe/silverstripe-widgets/blob/master/code/form/WidgetAreaEditor.php#L123, which if a checkbox is not checked it simply does not appear in the request data nore $_POST.

mparkhill pushed a commit that referenced this pull request Aug 6, 2014
@mparkhill mparkhill merged commit 8ee4066 into silverstripe:master Aug 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants