Problem/Motivation

Latest release 8.x-1.7 throws a critical error

Hi!
I've been happily using Superfish with its associated library on my Drupal 9 sites (online and local) using 8.x-1.6.
Today after updating to 8.x-1.7 my sites throw a critical error:
Errors found
Superfish library Not installed
Please download the Superfish library from https://www.drupal.org/project/superfish.
Please help!
Note.- If I remove Superfish and revert to previous version 8.x-1.6 all is well again.

Issue fork superfish-3392874

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

papijo created an issue. See original summary.

frank.dev’s picture

same

lobsterr’s picture

Assigned: Unassigned » lobsterr

I will check it

andreaciravolo’s picture

same

greatmatter’s picture

Line 47 of superfish.js has an error:

o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels),

should be

o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels);

magtak’s picture

Same

kwiseman’s picture

I agree with @greatmatter - Line 47 of superfish.js ending in a comma and not a semicolon is causing a problem for the site we've upgraded to 8.x-1.7.

However, our site is not getting the same error as @papijo. In the browser console, we're getting "Uncaught SyntaxError: expected expression, got keyword 'var'" on line 48.

papijo’s picture

@greatmatter I have replaced the ending comma with a semicolon in "MYDRUPALSITE\libraries\superfish\superfish.js" but am still getting the Superfish library Not installed error.
@kwiseman I am not getting any error in my browser console.
What I don't understand is that the Superfish library was working OK with previous version of Superfish 8.x-1.7, even if it had that syntax error, so I suppose the bug comes from Superfish module itself, not the library???

jlancaster’s picture

Same symptoms here as #7. Status report is clean but the "keyword var" error pops up in js console. Forcing downgrade to 1.6 or adding semicolon fixes.

magtak’s picture

I am getting

Uncaught TypeError: $menu.superfish is not a function
    attach http://mysite.ddev.site/modules/contrib/superfish/js/superfish.js?v=2.0:32
    each jQuery
    attach http://mysite.ddev.site/modules/contrib/superfish/js/superfish.js?v=2.0:21
    attachBehaviors http://mysite.ddev.site/core/misc/drupal.js?v=9.5.11:24
    attachBehaviors http://mysite.ddev.site/core/misc/drupal.js?v=9.5.11:21
    <anonymous> http://mysite.ddev.site/core/misc/drupal.init.js?v=9.5.11:24
    listener http://mysite.ddev.site/core/misc/drupal.init.js?v=9.5.11:14
lobsterr’s picture

Status: Active » Needs review

I have fixed a JS error from #5. A new release was tagged https://github.com/LOBsTerr/drupal-superfish/releases/tag/2.3.1

I checked he installation on the fresh instance and also tried to update. I don't have any issues.

jlancaster’s picture

Thanks. 2.3.1 release fixed the console error related to library and all is good now. Never had issues with library being found in status report so I can't speak to that being resolved or not.

kreatil’s picture

I'm not sure if this is related, but after updating to 8.x-1.7, the arrows that indicate the presence of a submenu have disappeared on my site. This doesn't seem to be a CSS issue, as the entire HTML tags are no longer being rendered.

Reverting back to 8.x-1.6 resolves the issue for me as well.

Can someone confirm that? If needed, I'm happy to open a separate issue for this.

gmejias’s picture

I have fixed the error in the superfish.js library and now I have no problems

This already happened in "Variable declaration problem with aggregation in library".

If you can add a patch for its temporary solution it would be perfect

drupalprog’s picture

i tried almost everything via composer, uninstall module then again install, replace superfish library again, change semicolon but no luck
finally i checked code & did some debugging & found
you need to rename folder "superfish" to "drupal-superfish" then it will recognized.

so path will be
libraries >> drupal-superfish

superfish module used superfish_library_path function in which library path is set to
$library = 'drupal-superfish'

hope it will helpful to others.

andreaciravolo’s picture

Ok
ha funzionato anche per me
Grazie
andrea

papijo’s picture

@drupalprog
I was really beginning to despair when finally I read your recent post, which I found not only "useful" but a real life-saver!
Why has this change of dir names not been made clear earlier on, I wonder?

Anyway Superfish 8.x-1.7 works as expected now. Thanks everyone!

lobsterr’s picture

Status: Needs review » Fixed
subir_ghosh’s picture

#15 removed the error for me.

donpwinston’s picture

I'm getting an error in my JavaScript console: "Failed to load resource: the server responded with a status of 404 (Not Found)"

The url is: https://<my domain>/libraries/superfish/superfish.js?s2jcvr

Where did this url come from?

I believe it should be:
https://<my domain>/libraries/drupal-superfish/superfish.js?s2jcvr

Just upgraded to Drupal 10.1.5 and upgraded superfish to 1.7. The menus appear to be working fine.

(After aggregating the js files and flushing caches the problem went away. The aberrant path must have been stuck in some cache, maybe an opcache problem)

Kashalinka’s picture

I fixed the comma/semicolon error in #5 and the error persisted. Then I followed the advice in #15 (change the libraries >> superfish folder name to drupal-superfish) and that removed the error for me. Thank you so much for sharing this fix. I have several Drupal sites, all using superfish and was groaning to think I might need to find another menu project to replace it. I'm very grateful to both "greatmatter" (#5) and "drupalprog" (#15.

greatmatter’s picture

@kashalinka: My pleasure. Question: did you install the module via composer? I ask because when I ran the update via composer, it automatically added the drupal-superfish folder.

sibany’s picture

@drupalprog #15 - working, Thanks

dknudsen’s picture

@greatmatter: I encountered to problem with the superfish library not being found when I used the Drupal administration interface to update the superfish module from 8.1.6 to 8.1.7 in Drupal 9.5.11. The library directory was still called superfish. I then used Composer to require superfish ^8.1.7, and the superfish library directory was deleted and properly replaced with drupal-superfish, as you surmised. All is working now.

I did not initially observe any of the errors noted above. The very obvious symptom was that all of my menus and submenus were expanded, and much of the basic CSS styling was missing. I was really sweating until I found this thread. Thanks to all!

effortdee’s picture

#15 worked for me

drupalprog’s picture

Welcome everyone.

Status: Fixed » Closed (fixed)

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

sandip choudhury’s picture

#15 works for me.

trydoknight’s picture

#15 solved this problem for me! Thanks

pooja_sharma’s picture

lobsterr’s picture

@pooja_sharma

The last release have already fixed the name of the VERSION file. so, we don't need to do what you propose.

https://github.com/LOBsTerr/drupal-superfish/commits/2.3.8

Current release requires 2.3.7 version of the library and it was fixed already there

https://git.drupalcode.org/project/superfish/-/blame/8.x-1.x/composer.js...

Update the library and it should work