Problem/Motivation

The field_timer module uses jQuery's countdown plugin which relies on $.isFunction() method. This method was removed in jQuery 3.3+ and causes errors when used with jQuery 4.0+.

Error:

Uncaught TypeError: a.isFunction is not a function
  at d._adjustSettings (jquery.countdown.js:488:27)
  at field_timer.js:30:23

Affected Code: field_timer/js/field_timer.js lines 28-50 (countdown plugin initialization)

Root Cause: The countdown plugin internally uses $.isFunction() which was removed from jQuery 3.3+

Steps to Reproduce

  1. Install field_timer module on a site with jQuery 4.0+
  2. Add a countdown field to any content type
  3. Create content with the countdown field
  4. View the content page
  5. Check browser console (F12)
  6. See error: "TypeError: a.isFunction is not a function"

Proposed Resolution

Add a jQuery compatibility polyfill to the beginning of field_timer.js that restores missing jQuery methods ($.isFunction, $.isWindow, $.isArray, etc.) for compatibility with jQuery 4.0+.

The polyfill:

  • Checks if methods exist before overriding
  • Uses native JavaScript equivalents
  • Logs success/errors to console
  • Has no performance impact on newer jQuery versions
  • Allows older plugins to work with modern jQuery

Remaining Tasks

  1. Review the proposed patch
  2. Test with jQuery 3.x and 4.x versions
  3. Merge patch into next release
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

afaqraza16 created an issue.