Hi,

In a clean install (not old versions of slick installed previously) , following installation instructions I've got this error:

Error: Class 'Drupal\slick\SlickManager' not found in slick() (line 28 of /var/www/clients/client1/web1/web/sites/all/modules/slick/slick.module).

I have it if use rc1, beta 3...

Ps.: Finally I've installed 7-2.1 version without errors.

Regards

Comments

calbasi created an issue. See original summary.

gausarts’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for the report!

May I know the autoloader module you use?

calbasi’s picture

Status: Postponed (maintainer needs more info) » Active

Sure: X Autoload

gausarts’s picture

X Autoload sounds to have the same issue like Autoload mentioned here:
https://git.drupalcode.org/project/blazy/blob/7.x-1.x/docs/README.md#kno...

Last time I tested X Autoload I had no missing classes. Only with Autoload, I did.
I will add your findings to the docs. Thanks!

gausarts’s picture

  • gausarts committed 582c325 on 7.x-3.x
    Issue #3045487 by calbasi: Error: Class 'Drupal\slick\SlickManager' not...
gausarts’s picture

Status: Active » Fixed

Added your info to docs. Thanks for contribution!

Status: Fixed » Closed (fixed)

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

erwangel’s picture

Still having this error with 3.0. (Drupal 7)
I have had installed it successfully but when for some reason I had to rebuild registry with drush rr (registry_rebuild module) I came to this error and since unable to run "drush aur" and "drush cc".
WD php: Error: Class 'Drupal\slick\SlickManager' not found in slick() (line 28 of /path_to/web/sites/all/modules/contrib/slick/slick.module).
Drush command terminated abnormally due to an unrecoverable error.

It completely broke my site. HTTP ERROR 500. Unable to uninstall it, "drush dis slick" throws the same message. I don't know how to bring my site back without having to reload from backup.

gausarts’s picture

Status: Closed (fixed) » Active

Thanks for the report!
That is why I still leave Slick 3.x as a non-recommended for now, as I haven't covered edge cases, yet.
Your report is surely helping me get more edge cases for more complete documentation.

If using Autoload.module:
It is likely Autoload.module cannot rewrite classes into autoload.php file.

Try renaming (do not delete in case another failure) autoload.php in your drupal root to something, and re-run drush aur, drush cc all.

This way Autoload will _hopefully regenerate a new autoload.php with the missing classes. In case it fails, be sure to have the expected folder permissions for the Autoload to kick in for a while.

If still an issue, try installing registry_autoload.module.
It is okay as a combo with autoload.module. You can uninstall Autoload.module once okay with registry_autoload.module.

erwangel’s picture

Thank you for the reply. I don't use autoload module, just registry_autoload.
I was able to have site back by executing registry_rebuild form inside the module dir

   cd sites/all/modules/contrib/registry_rebuild
   php registry_rebuild.php

and since I don't have the errors
I still can't understand why "drush rr" is throwing these errors and fails to complete.
Is it safe to uninstall slick 3.0 and go back to the 2.x version ?

Also disabling or enabling slick (or blazy as well) with drush (drush dis slick) breaks the composer.json file removing everything from "require" section but "php": ">=5.3.10" and replaces the "autoload" section with "psr-0" info.

gausarts’s picture

Status: Active » Postponed (maintainer needs more info)

Yes, the registry_rebuild should normally fix most class registry issues.

Blazy requires PHP 5.6 in the least. Perhaps that is part of the reason?

Is it safe to uninstall slick 3.0 and go back to the 2.x version ?

If you meant "uninstall", it should be safe. Typically all module configs and optionsets will be just gone.
If you meant "disable", and "downgrade", to be honest I haven't tried a downgrade. So I cannot confirm about this, sorry.

The provided updates changed variables, and also optionsets.

However as long as you don't store optionsets in codes via Bulk Exporter, or Features, it should be likely fine.
But I am afraid I cannot guarantee it for now.

Be sure to re-run registry_rebuild again if you do so.

Perhaps you could try a dev environment, and see if any issue.
Please update this issue with your findings either failure or success. Thanks!

gausarts’s picture

I came to this error and since unable to run "drush aur" and "drush cc".

"drush aur" was available if Autoload.module were installed.

erwangel’s picture

"drush aur" was available if Autoload.module were installed.

Indeed I realized that "aur" was an autoload.module command, but the problem of running drush commands like "cc all" or "rr" remains as well as breaking the composer.json (perhaps this last one is due to composer-manager, I have to test further with this module disabled)

I don't think there is a problem with php version, or, if one, its with code upgrading compatibility as I'm using php7.

Anyway, I didn't had to uninstall or downgrade slick 3. As I said, I was able to get site back after rebuilding registry (with the method I mentioned, not with drush rr) and Slick is working as expected despite its usage remains to me something obscure by lacking a good documentation, but that's an other problem.

To resume, the main issue is when you have to run a registry rebuild with drush then slick throws the "WD php: Error: Class 'Drupal\slick\SlickManager' not found in slick() (line 28 of /path_to/web/sites/all/modules/contrib/slick/slick.module)" and the entire site becomes unavailable with a 500 WSD. Hope that helps

codekarate’s picture

I can confirm I have this same issue using the Registry Autoload module. I am able to get it to work by running the following DB query:

update system
set status = 0
where filename IN ('sites/all/modules/contrib/slick/slick.module', 'sites/all/modules/contrib/blazy/blazy.module')

Followed by running drush rr two times (the first time will fail, the second will finish). The problem is if you run drush rr again, it will fail and you have do to the entire process over. Any ideas on a more permanent solution?

I would like to use 3.0 in an upcoming production site, but this is the only problem that I seem to be having. Let me know if there is anything I can do to help debug or come up with a solution.

gausarts’s picture

Interesting. I ran drush cc all like many times, and didn't notice this issue. If I could, I already put a notice earlier.

Branch 3.x is not in recommended status, yet. due to holding issues like this.
Thank you for confirming this also happens with Registry autoload. We'll need to update docs with your findings.

codekarate’s picture

Did you try running `drush rr` to rebuild the registry? That is where I am noticing the problem. `drush cc all` always works fine. It's only when using registry rebuild that it seems to cause the problems.

gausarts’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

You are right. I just noticed it with drush rr.

This type of CLI issue also happened with another issue on this project, I forgot the exact link. You will find one by searching "drush"

The solution is similar to both: when CLI fails, try the good old browser.

The solution was actually written in both Slick branches: "Know how to run registry_rebuild safely."
What I meant with "safely", is rename "registry_rebuild" to some random name, not easy to guess, or run once and delete it.

I am changing the status as it is obviously nothing to do with Slick, nor autoloader classes. And we had the solution, written there all along.
This should be no blocker no more.

Status: Fixed » Closed (fixed)

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

cosolom’s picture

Was the same problem with xautoload (I can't enable module because this error), but all fine with registry_autoload

jenlampton’s picture

I hit the same problem with xautoload and 7.x-3.1 (which is now the currently recommended release). Downgrading to 7.x-1.2 solved the issue for me also.

matas.k’s picture

Ran into this problem because of PHP 8.1 issues with autoload, dblog spams some error on any page load, could not find any solution or patch so decided to try alternatives.

Steps:

  1. Disable autoload. It causes to disable following modules blazy, blazy_ui, slick, slick_fields, slick_extras, slick_views, slick_example, slick_ui
  2. Enable xautoload, but you can only enable blazy, blazy_ui, you cannot enable slick, it throws errors:

    WD php: Error: Class 'Drupal\slick\SlickManager' not found in slick() (line 28 of /htdocs/sites/all/modules/slick/slick.module).               [error]
    Error: Class 'Drupal\slick\SlickManager' not found in slick() (line 28 of /htdocs/sites/all/modules/slick/slick.module).
  3. Completely disable and uninstall both autoload and xautoload, enable registry_autoload latest dev version, as of this post it is 7.x-1.x-dev 2023-Feb-28 version.
  4. Try to rebuild registry, both with drush rr and using registry_rebuild. Don't forget to clear caches drush cc all.
  5. Attempt drush en blazy, blazy_ui, slick, slick_fields, slick_extras, slick_views, slick_example, slick_ui. All modules install no errors.

There's also another autoloader module that is not documented, but is listed when trying to enable blazy with drush psr0.