plone / plone/plone.patternslib

Traceback with `andSelf` while trying to initialize leaflet pattern (Plone 6)

Open
#57 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 type: bug
Dominant language
Python
Stars
2
Forks
5
Avg merge
7h 25m
Merged PRs (30d)
2

Description

On Plone 6 (buildout.coredev), we have a traceback when trying to use leaflet (because of andSelf removal in jQuery > 3):

patterns.pat.leaflet: Failed while initializing 'leaflet' pattern. TypeError: $el.parents().andSelf is not a function

Replacing it by addBack() works like a charm ... for this pattern.

I don't know how jQuery versions are handled between the different Plone packages / patterns, so I would like to have inputs on the best way to fix that everywhere without breaking code still using old jQuery version(s).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the leaflet pattern code that calls $el.parents().andSelf, then inspect how supported jQuery versions are handled across the pattern packages. Reproduce leaflet initialization on Plone 6 and verify the pattern works with the supported versions without breaking older jQuery compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.