-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
This file is part of the SemanticMetaTags extension, it is not a valid entry point. #76
Comments
Note that this happens for other semantic extensions, too. I can confirm Semantic Compound Queries and Semantic Breadcrumb Links. I will have to look once I have time to which extensions are at play, too. |
See also CanastaWiki/Canasta#251 |
You are correct that autoloading is causing the issue, but let me fully explain the issue, since I discovered the same problem in another extension (which it turns out is reported in Canasta issue #251. It's not the Removing dependencies in ComposerThe correct process for removing a problem "library" such as SemanticMetaTags from Composer is to first delete the line from ( Same error in SemanticBreadcrumbLinksI'm getting this same reported error from the SemanticBreadcrumbLinks extension, and we can see that the classes are referenced in the generated autoload files:
Let's try our temporary workaround
truncated output showing that
The root causeThe root cause of this problem is that a lot of "older" MediaWiki extensions or "simple" extensions with one class file often do not follow PSR1 or PSR4 auto-loading techniques where the code for classes is separate and distinct from other 'plumbing' code. For example, it's bad practice to have the same file hold a class definition AND also have it Proper examplesSee the autoload section of composer.json in SemanticMediaWiki v4.1.2 offers a full range of the Composer autoload keys and conventions. And remember, Composer autoloading (for dependency management) is separate but related to the MediaWiki autoload functionality in core and configured in extension.json There's a simple classmap example of the CDB library (not MediaWiki extension). CDB is installed by Composer and does a straight Fixing SemanticMetaTagsI think the correct fix for SemanticMetaTags is to remove DefaultSettings.php from the autoload['files'] section of composer.json. The only code that needs it is SemanticMetaTags.php in the load() method which does its own |
Your workaround does not work for me because I have multiple problematic extensions in my composer.local.json file. Is your suggested permanent fix seeking something like this: CanastaWiki/Canasta#280 (comment)? |
Did not try the fix, but the temporary workaround does not work for me. |
Setup and configuration
Issue
MediaWiki 1.39.x, Compser 2.x and SMT no longer play nicely. If you install this extension via Composer, it works, however, if you would like to run
composer update --no-dev
at some later point, you will get the following error message:This file is part of the SemanticMetaTags extension, it is not a valid entry point.
The error is preventing Composer from being executed. To mitigate, you must delete the
/vendor/
directory and runcomposer update --no-dev
again to get the software in. Just removing the inclusion of the extension from "LocalSettings.php" and from "composer.local.json" does not mitigate the issue.Suspicion is that autoloading files via "composer.json" is causing the issue: https://github.com/SemanticMediaWiki/SemanticMetaTags/blob/3.0.0/composer.json#L44 I do not know for sure if this is the cause.
The text was updated successfully, but these errors were encountered: