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
- Install field_timer module on a site with jQuery 4.0+
- Add a countdown field to any content type
- Create content with the countdown field
- View the content page
- Check browser console (F12)
- 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
- Review the proposed patch
- Test with jQuery 3.x and 4.x versions
- Merge patch into next release
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2026-07-02 at 11.42.30 AM.png | 212.83 KB | afaqraza16 |
Issue fork field_timer-3607867
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