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

Umbraco 7.2.8 Breaks DateTime in U7-Grid-Data-Type #1

Open
FyinInc opened this issue Aug 11, 2015 · 1 comment
Open

Umbraco 7.2.8 Breaks DateTime in U7-Grid-Data-Type #1

FyinInc opened this issue Aug 11, 2015 · 1 comment

Comments

@FyinInc
Copy link

FyinInc commented Aug 11, 2015

https://our.umbraco.org/projects/backoffice-extensions/u7-grid-data-type/questions-bugs-issues-feedback/70317-datepicker-not-populating-correctly-umbraco-728

Datepicker not populating correctly Umbraco 7.2.8

I ran into this in a project upgraded from 7.1.x to 7.2.8. The problem is due to some Umbraco changes to their stock DatePicker that break the way DTG was using them. I believe this commit is the one that introduced the issue (umbraco/Umbraco-CMS@43f99e1), but several others are at play too.

In this commit, they essentially introduced a "render model" and use that to store the "live" picked value, then when the page is saved (via formSubmitting event), they assign that value to $scope.model.value, which is what DTG is reading. The problem is that DTG also relies on the formSubmitting event, but DTG's is firing first, before the DatePicker has had a chance to assign to $scope.model.value, thus it sees an empty value. Even though you see the picked value in the textbox at first, DTG never actually knows about it since it's not on $scope.model.value yet. This worked before because the datepicker was bound directly to $scope.model.value.

Unfortunately there is no way to control the order of formSubmitting events, and in general it's not a reliable way to handle nested properties.

That being said, here is one hacky workaround that does fix the issue But, I don't know what other problems it might introduce without spending some more time on this, so you'll definitely want to test. This is more to prove the issue and not meant to be a production fix.

The hack: /umbraco/Js/umbraco.controllers.js After line 4849, add: $scope.model.value = $scope.datetimePickerValue;

Some ideas for a proper fix:

Update DTG to force formSubmitting events, similar to Archetype
Update DTG to read the DatePicker value differently, maybe by accessing the render model instead or querying the textbox directly

https://Fyin.com
https://www.linkedin.com/in/DavidDimmer

@harvzor
Copy link

harvzor commented Sep 16, 2015

Thanks for posting about this FyinInc. I have also just came accross this problem in Umbraco 7.2.8.

You temporary fix has instantly fixed the bug on my installation. Thanks for that!

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

No branches or pull requests

2 participants