Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18506

Undefined txtHour[0] warning when using Date Picker

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: 4.6.0-dev
    • Fix Version/s: QA tracked issues
    • Component/s: Misc
    • Labels:
      None

      Description

      Hi,
      When i:

      • create a class with a textine and a date attribute
      • then, having firebug enabled, when creating a content object of that class, when i choose the date using the date picker, i have the following warning:
        "txtHour[0] is undefined".
        This warning is related with line 30 of the design/standard/javascript/ezdatepicker.js file.

      if i do the same without firebug, i have no error/warning in the debug and i create the object without any problem.

      Steps to reproduce

      Test case  - Create Date class
      1 - Create a content class with the following data:
      Name: A Date Class
      Identifier: a_date_class
      Description: This is a date class test
      Object name pattern: <name>
      URL alias name pattern: 
      Container: Unchecked
      Default sorting of children: Path String / Ascending
      Default object availability: unchecked
       
      Add a Text line Attribute
      Name: Name
      Identifier: name
      Description: This is a test
      Required: UnChecked
      Searchable:: Checked
      Information Collector: Unchecked
      Disable Translation: Unchecked
      Category: Default (Content)
      Max String Lenght: 0 Characters
       
      Add a Date Attribute
      Name: Date
      Identifier: date
      Description: This is a Date test
      Required: Checked
      Searchable:: Checked
      Information Collector: Unchecked
      Disable Translation: Unchecked
      Category: Default (Content)
      Default value: current date
       
      1 - Create a new “A Date Class” content. Firebug must be enabled:
      2 - Use the following data, using the date picker:
      Name = “TD1“
      Date: <today's date>
      

      1. ezdatepicker.js
        2 kB
        Bartek Modzelewski

        Activity

        Hide
        Damien Pobel (eZ) added a comment -

        Hi,

        I'm not able to reproduce this issue. It is perhaps already fixed or this is related to your firebug's console configuration. Could you click on the arrow that is at the right of the "Console" tab and list me which configuration items are enabled.

        Cheers

        Show
        Damien Pobel (eZ) added a comment - Hi, I'm not able to reproduce this issue. It is perhaps already fixed or this is related to your firebug's console configuration. Could you click on the arrow that is at the right of the "Console" tab and list me which configuration items are enabled. Cheers
        Hide
        Paulo Cardiga added a comment -

        Hi Damien,
        I re-tried the situation and this error no longer happens to me as well.
        I'll close this issue as "not able to reproduce anylonger"

        Show
        Paulo Cardiga added a comment - Hi Damien, I re-tried the situation and this error no longer happens to me as well. I'll close this issue as "not able to reproduce anylonger"
        Hide
        Geir Arne Waaler added a comment -

        This issue is either solved or works as intended. I move it to Closed.

        Show
        Geir Arne Waaler added a comment - This issue is either solved or works as intended. I move it to Closed.
        Hide
        Bartek Modzelewski added a comment -

        Hello,

        I reopen this ticket as for me there is a little bug. I don't reproduce problems reported by Paolo, but I just was wondering why datepicker doesn't close when date is selected (for ezdate datatype only). I've found that script stops on mentioned line 30 of datepicker.js. It's because it's failing on undefined txtHour[0] var. I dunno why Firefox/Firebug nor Chrome reports any JS error, but for sure there is an error. The only pb is that datepicker stays open - this.hide(); is never executed.

        NOTE: it's only true for ezdate datatype, not ezdatetime datatype ! (as everything is ok when hour & min fields exists)

        I managed to quickly fix it by modifing lines 30 & 35 to :
        if ( txtHour[0] && txtHour[0].value == '' ) {
        and
        if ( txtMinute[0] && txtMinute[0].value == '' )

        I'm not JS master, so maybe there is more elegant way to fix it, but for me it makes datepicker work well. (eZ Publish 4.6.0 EE)

        (I attached fixed datepicker.js to this ticket)

        Show
        Bartek Modzelewski added a comment - Hello, I reopen this ticket as for me there is a little bug. I don't reproduce problems reported by Paolo, but I just was wondering why datepicker doesn't close when date is selected (for ezdate datatype only). I've found that script stops on mentioned line 30 of datepicker.js. It's because it's failing on undefined txtHour [0] var. I dunno why Firefox/Firebug nor Chrome reports any JS error, but for sure there is an error. The only pb is that datepicker stays open - this.hide(); is never executed. NOTE: it's only true for ezdate datatype, not ezdatetime datatype ! (as everything is ok when hour & min fields exists) I managed to quickly fix it by modifing lines 30 & 35 to : if ( txtHour [0] && txtHour [0] .value == '' ) { and if ( txtMinute [0] && txtMinute [0] .value == '' ) I'm not JS master, so maybe there is more elegant way to fix it, but for me it makes datepicker work well. (eZ Publish 4.6.0 EE) (I attached fixed datepicker.js to this ticket)
        Hide
        Bartek Modzelewski added a comment -

        ezdatepicker.js Fixed version of datepicker.js

        Show
        Bartek Modzelewski added a comment - ezdatepicker.js Fixed version of datepicker.js
        Hide
        André Rømcke added a comment -

        Moving issue back to Backlog as it is not actively in development.

        Show
        André Rømcke added a comment - Moving issue back to Backlog as it is not actively in development.
        Hide
        André Rømcke added a comment -

        Fixed in: https://github.com/ezsystems/ezpublish/commit/08e6ae2ed6b2b561920d647dc1a9f6feda5d2d95

        This issue should cause problems for closing datepicked when used on a ezdate attribute.

        Show
        André Rømcke added a comment - Fixed in: https://github.com/ezsystems/ezpublish/commit/08e6ae2ed6b2b561920d647dc1a9f6feda5d2d95 This issue should cause problems for closing datepicked when used on a ezdate attribute.
        Hide
        Marcos Loureiro (Inactive) added a comment -

        QA Approved

        Show
        Marcos Loureiro (Inactive) added a comment - QA Approved

          People

          • Assignee:
            Unassigned
            Reporter:
            Paulo Cardiga
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Time Spent - 3 hours, 15 minutes Remaining Estimate - 3 hours
              3h
              Logged:
              Time Spent - 3 hours, 15 minutes Remaining Estimate - 3 hours
              3h 15m