Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Allan Hawkey 232 posts 303 karma points
    Jul 29, 2015 @ 21:55
    Allan Hawkey
    0

    Datepicker broken in 7.2.8

    I've just upgraded several sites from 7.2.6 to 7.2.8. I've found that the datepicker now gives errors where I use it in uBlogsy for the Post Date for blog posts.

    For existing items, the new datepicker fails to display the date previously entered (it's a mandatory field, so I am certain it was populated) and when I try to save & publish, I get an error message because the mandatory field is blank. When I use the new datepicker to enter a date, it displays a date in the field but still fails to save.

    Any ideas what could be causing this or how to fix it?

    For now, I've found that reverting to the umbraco.controllers.js from 7.2.6 gets things working again, but that seems to be a bit of a backwards step...

    Thanks,

    Allan

  • Sebastiaan Janssen 4851 posts 14444 karma points MVP admin hq
    Jul 30, 2015 @ 12:25
    Sebastiaan Janssen
    0

    I've just installed uBlogsy in a 7.2.8 solution, created a new blog post and set the date. I can then save & publish it just fine.

    I think you might have some browser caching going in. Please, please copy back the 7.2.8 umbraco.controllers.js (you are guaranteed to get other problems if you use a different version than what Umbraco shipped with).

    Then make sure to change the version in ClientDependency.config and finally open a private/incognito browser window to make sure you have no cached files laying around that could be problematic.

    If you still have trouble saving the date then make sure to copy the error in this post.

  • Allan Hawkey 232 posts 303 karma points
    Aug 11, 2015 @ 17:02
    Allan Hawkey
    0

    Hi Sebastiaan, I'm still having trouble with this - I've followed the steps you suggested, but uBlogsy posts are still not saving correctly.

    When I create a new post, today's date and time is populated in the post date field. When I try to save it, I get an error. All it says is "Property has errors" in the red bar at the top of the screen and the Post Date field is flagged in red with the note "Invalid Date".

    If I then go in to the date picker and re-select today's date and time manually, then save it, it works.

    This is all in Firefox (normal and private window) after updating the version in ClientDependency.config

    It works ok in Chrome though...??

    Any other ideas for how to fix this in Firefox?

    Thanks, Allan

  • Allan Hawkey 232 posts 303 karma points
    Aug 11, 2015 @ 17:19
  • David Dimmer 76 posts 134 karma points
    Aug 12, 2015 @ 16:21
    David Dimmer
    0

    Did you try Our Hack to see if it fixes your issue?


    David Dimmer - LinkedIn

    Fyin.com, Umbraco Experts

  • Allan Hawkey 232 posts 303 karma points
    Aug 12, 2015 @ 20:37
    Allan Hawkey
    1

    Hi David, thanks for that, but unfortunately the issue is still there in Firefox. It does seem to be related, so I wonder if there's anything else you've seen which could be causing this?

    Thanks, Allan

  • mscommunities 40 posts 93 karma points
    Aug 27, 2015 @ 05:52
    mscommunities
    0

    I can also confirm this bug. We are on v7.2.8 right now and if we save a previously published node that has a 'Date Picker with time' property, it will not save. It will give us a 'Property has errors' message even though the field is clearly showing a valid date and time in the textbox. In order to proceed, we have to clear out the time portion and re-enter it.

    Screenshot of error

  • Kenneth Solberg 223 posts 413 karma points
    Aug 27, 2015 @ 06:29
  • Allan Hawkey 232 posts 303 karma points
    Aug 27, 2015 @ 10:13
    Allan Hawkey
    0

    There's a fix for this issue now: http://issues.umbraco.org/issue/U4-6953

    Hope that helps, Allan

  • Osman Coskun 146 posts 345 karma points
    Nov 10, 2015 @ 12:39
  • Neil Marshall 10 posts 63 karma points
    Mar 04, 2016 @ 13:18
    Neil Marshall
    0

    A little late to the party but we were having similar issues to this in Umbraco 7.3.4. We use a uk date format for the date picker data type.

    Upon trying to publish a document with an existing date pre-populated we would receive the "Invalid Date" error.

    The fix from 7.2.8 doesn't now seem valid in 7.3.4 and the controller code has changed.

    We used the following code and this appears to have fixed the issue for our situation but we haven't yet tested the full scope of use for the date picker so can't guarantee it will resolve all issues (and indeed not introduce new issues)... however it's worth a try:

    It looked like in the situation where a date was pre-populated when the document edit form was loaded, although some $scope values were being set it seems like something wasn't being set correctly which was causing the issue. So we added a call to the applyDate method in the controller passing the pre-populated date as a moment object. This mimics what happens when a date is selected using the UI and looks like it resolves the issue (but see the above disclaimer!). The commented out line is also called in applyDate and appears to be surplus.

    Around Line 5177 (in our version) of /umbraco/js/umbraco.controllers.js you'll see

    if ($scope.hasDatetimePickerValue) {
                        //assign value to plugin/picker
                        var dateVal = $scope.model.value ? moment($scope.model.value, $scope.model.config.format) : moment();
                        element.datetimepicker("setValue", dateVal);
    comment this out -> //$scope.datetimePickerValue = moment($scope.model.value).format($scope.model.config.format);
    add this ->         applyDate({ date: moment($scope.model.value) });
                    }
    

    Not meaning to hijack the thread... it just might be useful as I haven't seen this resolved yet in the issue tracker (but do often miss things!!!)

Please Sign in or register to post replies

Write your reply to:

Draft