Bug #93729

Wrong check for undefined in DateTimePicker

Added by Nikita Hovratov about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
Start date:
2021-03-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

64      if (element.dataset.datepickerInitialized !== 'undefined') {
65        return;
66      }

Should be typeof check

#1

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68374

#2

Updated by Tymoteusz Motylewski about 1 year ago

any hints how to reproduce it? CR seems easy, but would like to give "verified" vote too.

#3

Updated by Nikita Hovratov about 1 year ago

Tymoteusz Motylewski wrote in #note-2:

any hints how to reproduce it? CR seems easy, but would like to give "verified" vote too.

I found this by upgrading my extension to v11. I don't know if you can find an error in TYPO3 itself.
But this is definetely wrong if you compare this with version 10.4, where the typeof check was still present:

    const $dateTimeFields = $(selector || this.fieldSelector).filter((index: number, element: HTMLElement): boolean => {
      return typeof $(element).data('DateTimePicker') === 'undefined';
    });
#4

Updated by Nikita Hovratov about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#5

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF