Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0/develop missing dependencies #195

Open
dnkmdg opened this issue Jun 10, 2021 · 6 comments
Open

3.0/develop missing dependencies #195

dnkmdg opened this issue Jun 10, 2021 · 6 comments

Comments

@dnkmdg
Copy link

dnkmdg commented Jun 10, 2021

Branch: 3.0/develop

Environment: macOs, Wordpress 5.7.2, Nginx

Issue:
Fatal error: Uncaught Error: Class 'ComponentLibrary\Init' not found in /themes/municipio/library/Template.php on line 16

Steps to reproduce:
Clone fresh repo into a local WP themes directory. Install npm/composer dependencies. Activate theme. Boom goes WP.

@sebastianthulin
Copy link
Member

Install https://github.com/helsingborg-stad/component-library. This is a required component to run 3.0 branch.

@dnkmdg
Copy link
Author

dnkmdg commented Jun 10, 2021

Install https://github.com/helsingborg-stad/component-library. This is a required component to run 3.0 branch.

I did install this after some googling, although PHP/WP doesn't seem to recognize the ComponentLibrary\Init class.

@sebastianthulin
Copy link
Member

There might be an loading issue. It might sound wierd, but try to install Modularity 3.0 branch, loading should be fixed there.

@dnkmdg
Copy link
Author

dnkmdg commented Jun 10, 2021

Good idea, but unfortunately no luck. When switching to 3.0/develop-modularity-compability, rimraffing /vendor and doing a fresh composer install I get a version of the same error, only this time pointing to BladeComponentLibrary\Init instead of the original ComponentLibrary.

@sebastianthulin
Copy link
Member

sebastianthulin commented Jun 10, 2021

There might be multiple culprits here. Try to:

  • Composer install in all of the plugins (or php build.php). If you haven't already.
  • Move the Component Library plugin to the mu-plugins folder to enshure that i loads first. This requires a root-file in the mu-plugins directory including main php file of component library ( component-library.php ).

@dnkmdg
Copy link
Author

dnkmdg commented Jun 10, 2021

Ah, that did the trick. When installing the component-library from the theme root a wild wp-content folder appeared in the theme root. Moving this to mu-plugins and setting up a loader fixed it.

This should be documented as a preface to installing Municipio though - or have I missed some crucial documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants