Problem/Motivation

It throws error when when I press keyboard left-right button. (It works so I can slick the images with keyboard but I got error at every keypress)

Uncaught TypeError: this.slick is undefined
    slideSlick slick-lightbox.min.js:204
    bindEvents slick-lightbox.min.js:185

Steps to reproduce

Create a custom content type
Create a field "field_images" (Unlimited images)
Create a dummy content with images
Go to field settings and display (/admin/structure/types/manage/YOUR_TYPE/display)
Change your images formatter to "Slick Image"
Set the Optionset: default
Set the Media switch: slick_lightbox
Save and View the Node
Click to image and press right
Error happening at every keypress (left/right)

Debugging

Issue at:
Code

Debugging:
Code
Console

My composer.json

Packages:

{
            "type": "package",
            "package": {
                "name": "kenwheeler/slick",
                "version": "1.8.0",
                "type": "drupal-library",
                "source": {
                    "url": "https://github.com/kenwheeler/slick",
                    "type": "git",
                    "reference": "1.8.0"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "mreq/slick-lightbox",
                "version": "v0.2.12",
                "type": "drupal-library",
                "source": {
                    "url": "https://github.com/mreq/slick-lightbox",
                    "type": "git",
                    "reference": "v0.2.12"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "dinbror/blazy",
                "version": "1.8.2",
                "type": "drupal-library",
                "source": {
                    "url": "https://github.com/dinbror/blazy",
                    "type": "git",
                    "reference": "1.8.2"
                }
            }
        }

require:

        "dinbror/blazy": "^1.8",
        "drupal/slick": "^2.3",
        "drupal/slick_lightbox": "^1.3",
        "kenwheeler/slick": "^1.8",
        "mreq/slick-lightbox": "^0.2.12",

Any idea to fix this issue?

Comments

kecsot created an issue. See original summary.

kecsot’s picture

Issue summary: View changes
gausarts’s picture

Status: Active » Needs review
StatusFileSize
new8.58 KB

Thank you.

You are correct. My mistake, I didn't give what it wants :)

Let me know if this fixed it.

  • gausarts committed 6cb037f on 8.x-1.x
    Issue #3240904 by gausarts, kecsot: this.slick is undefined at keypress
    
gausarts’s picture

Status: Needs review » Fixed
Issue tags: -custom module

Committed. Thank you for contribution!

kecsot’s picture

Works well.

I'm really happy because 1.4.0 version released with this fix. It was so fast :)
Thank you for your work!

kecsot’s picture

StatusFileSize
new8.17 KB

There is a minified js inside your patch.
When you create a patch then you generate a new slick-lightbox.load.min.js.
Maybe you did this patch after another patch.
So basically I can't apply this .js to the released 1.3.0 version.

If someone wants to apply 2 patches from this project, then it's impossible. (If patches affect the same js)

I suggest to remove the minified js from the project.

Here is a patch for 1.3.0 release.

gausarts’s picture

This was already included in release 1.4.

No need to include these patches at 1.3.
Be sure to start with full releases when available, not backwards, else headaches :)
Dev version is fine, but not backwards.

Must move forwards.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.