professionalwiki / bootstrap Goto Github PK
View Code? Open in Web Editor NEWProvides the Bootstrap 4 web front-end framework to MediaWiki skins and extensions
Home Page: https://www.mediawiki.org/wiki/Extension:Bootstrap
License: Other
Provides the Bootstrap 4 web front-end framework to MediaWiki skins and extensions
Home Page: https://www.mediawiki.org/wiki/Extension:Bootstrap
License: Other
On the ScoutWiki farm we get this error when we update to 1.29 from 1.27 with the extension enabled: "Fatal error: Call to a member function ucfirst() on a non-object in /srv/www/scoutwiki/htdocs-1.29/includes/user/User.php on line 1079" when loged in. And the error "Fatal error: Call to a member function getCode() on a non-object in /srv/www/scoutwiki/htdocs-1.29/includes/user/User.php on line 1578" when loged out. With all debug options enabled, these are the only lines written, no stack trace. Test on https://uk.scoutwiki.org also errors with no other extensions enabled.
A new version of scssphp was released today: https://github.com/scssphp/scssphp/releases/tag/v1.5.0
With the previous version this issue does not happen: https://github.com/scssphp/scssphp/releases/tag/v1.4.1
When using scssphp v1.5.0 with:
This might be a SCSS library issue instead, but I'm logging it here since the error mentions a problem with Bootstrap.
When loading any page the CSS is not loaded:
When loading the page with ?debug=true
an error can be seen in the Bootstrap/Chameleon CSS:
Response:
/* SCSS compile error: $n: List index may not be 0.: extensions/Bootstrap/resources/bootstrap/scss/mixins/_box-shadow.scss on line 13, at column 9
Call Stack:
#0 mixin box-shadow extensions/Bootstrap/resources/bootstrap/scss/_custom-forms.scss on line 36
#1 import extensions/Bootstrap/resources/bootstrap/scss/_custom-forms.scss (unknown file) on line 1*/
I downloaded mediwiki bootstrap master (mw1.26.4) , put it in a directory 'bootstrap' under 'extensions' and added in composer.json under require
"mediawiki/bootstrap": "1.2.1"
but there happens no installation
Bundle SCSS with Bootstrap: #49 (comment)
PHP module: #49 (comment) (https://github.com/absalomedia/sassphp)
Released on 28 October:
https://blog.getbootstrap.com/2021/10/28/bootstrap-4.6.1/
Kthx :)
This is not a bug or a feature request. I'm looking at using the Chameleon skin, and by proxy this extension, on a new wiki (MW 1.35.1). When starting a new project I prefer having the latest versions of dependencies, even if there are no specific requirements from my side.
Is there a technical reason why this extension is still using Bootstrap 4.3? I couldn't find any references to issues with either 4.4 or 4.5. Is it simply a matter of everything is working fine and there have not been any requests for features in the newer versions of Bootstrap?
In other words, if I were to bump the Bootstrap library version to 4.5.3, should I expect known issues? I'm going to try this in any case, but just want to make sure whether I should be aware of anything.
I am running phpcs via composer like this:
$ composer phpcs tests/phpunit/includes/OutputPageTest.php
> phpcs -p -s 'tests/phpunit/includes/OutputPageTest.php'
.
Time: 521ms; Memory: 12Mb
I have added mediawiki/chameleon-skin
to my composer.local.json
like this:
{
"require": {
"mediawiki/chameleon-skin": "~1.0",
"mediawiki/vector-skin": "@dev"
}
}
Running composer update
installs the Bootstrap extension:
$ composer update
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 1 update, 0 removals
- Installing mediawiki/bootstrap (1.2.3): Loading from cache
- Installing mediawiki/chameleon-skin (1.6.0): Loading from cache
Writing lock file
Generating optimized autoload files
After this, unfortunately, phpcs does no longer work:
$ composer phpcs tests/phpunit/includes/OutputPageTest.php
> phpcs -p -s 'tests/phpunit/includes/OutputPageTest.php'
This file is part of the MediaWiki extension Bootstrap, it is not a valid entry point.
Hi
I have encountered a RuntimeException after upgrading from 1.2.1 to 1.2.2. Seems the problem orginates in $wgScriptPath
being an empty string ("").
here are some of the settings from Bootstrap/Bootstrap.php prior to the $setupAfterCache->process();
call;
wgScriptPath:
IP: /var/www/extdev/mediawiki-1.27.4
wgExtensionAssetsPath: /extensions
localBasePath: /extensions/Bootstrap/resources/bootstrap
As you can see the str_replace
on line 80 calculates the wrong localBasePath
. Should be /var/www/extdev/mediawiki-1.27.4/extensions/Bootstrap/resources/bootstrap
. :(
And here is the exception
Exception encountered, of type "RuntimeException"
[23a774b1a3eb1dc216181372] /Spezial:Spezialseiten RuntimeException from line 162 of /var/www/extdev/mediawiki-1.27.4/extensions/Bootstrap/src/Hooks/SetupAfterCache.php: Expected an accessible /extensions/Bootstrap/resources/bootstrap path
Backtrace:
#0 /var/www/extdev/mediawiki-1.27.4/extensions/Bootstrap/src/Hooks/SetupAfterCache.php(68): Bootstrap\Hooks\SetupAfterCache->isReadablePath(string)
#1 /var/www/extdev/mediawiki-1.27.4/extensions/Bootstrap/Bootstrap.php(87): Bootstrap\Hooks\SetupAfterCache->process()
#2 [internal function]: {closure}()
#3 /var/www/extdev/mediawiki-1.27.4/includes/Hooks.php(195): call_user_func_array(Closure, array)
#4 /var/www/extdev/mediawiki-1.27.4/includes/Setup.php(694): Hooks::run(string)
#5 /var/www/extdev/mediawiki-1.27.4/includes/WebStart.php(137): require_once(string)
#6 /var/www/extdev/mediawiki-1.27.4/index.php(40): require(string)
#7 {main}
see context at
https://phabricator.wikimedia.org/T181719
recent changes to
localBasePath
such as in
fb5f98e
seem likely to be the source of the trouble
Hi @s7eph4n
Since mw skins often rely on positioning and z-index, things sometimes get messy [0]. When using bootstrap modals for example, the backdrop is added by javascript at the very end of the body tag. Which in turn causes the backdrop to actually overlay the modal, including the close button. A workround so far was to disable the backdrop, which does the trick but produces a modal that does not quite behave like a bootstrap modal. A fix for mw skins is to add the backdrop to the #content element instead of the body tag. This can be done easily with
diff --git a/resources/bootstrap/js/modal.js b/resources/bootstrap/js/modal.js
index f84142d..237f64d 100644
--- a/resources/bootstrap/js/modal.js
+++ b/resources/bootstrap/js/modal.js
@@ -15,7 +15,7 @@
var Modal = function (element, options) {
this.options = options
- this.$body = $(document.body)
+ this.$body = $(' #content' )
this.$element = $(element)
this.$dialog = this.$element.find('.modal-dialog')
this.$backdrop = null
However, since the bootstrap javascript is an external resource, I was wondering if there is an alternative to that. Or do you see a possibility to integrate this change in your extension?
Cheer,
Tobi
[0] https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
Since mediawiki/mediawiki is not a valid package name, my scrutinizer test breaks [0]. Is there a reason this was added? Can we safely remove it? If not, can somebody point me to a scrutinizer config that lets me ignore this? @JeroenDeDauw maybe?
Hi, could this be supported without needing composer please?
Im getting
Error from line 93 of /srv/mediawiki/w/extensions/Bootstrap/Bootstrap.php: Class 'Bootstrap\Hooks\SetupAfterCache' not found
Just recently, MediaWiki Core switched the dependency "oyejorge/less.php" to "wikimedia/less.php" [1], which is a fork of the former one. This change also got applied to the 1.31 release which is the current LTS version of MediaWiki.
This causes trouble with the dependency
"oyejorge/less.php" : "~1.0,>=1.7.0.9,!=1.7.0.13"
of this extension. Now both libraries are pulled and composer complains about "Ambiguous class resolution".
Would it be possible for this extension to switch to "wikimedia/less"? The description of the change says "Supports PHP 7.3, among other things". Unfortunately I don't know what "other things" might be.
I install the Package on a new Mediawiki Version and get following Error:
`[YgKCiMBtswvTd6yXl6FSbgAAVyE] /load.php?lang=de&modules=ext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.ui.button%7Cskins.chameleon%7Czzz.ext.bootstrap.styles&only=styles&skin=chameleon Error: Call to undefined function SCSS\wfMemcKey()
Backtrace:
from /extensions/Bootstrap/SCSS/ResourceLoaderSCSSModule.php(188)
#0 /extensions/Bootstrap/SCSS/ResourceLoaderSCSSModule.php(128): SCSS\ResourceLoaderSCSSModule->getCacheKey(ResourceLoaderContext)
#1 /extensions/Bootstrap/SCSS/ResourceLoaderSCSSModule.php(112): SCSS\ResourceLoaderSCSSModule->retrieveStylesFromCache(ResourceLoaderContext)
#2 /includes/resourceloader/ResourceLoaderModule.php(782): SCSS\ResourceLoaderSCSSModule->getStyles(ResourceLoaderContext)
#3 /includes/resourceloader/ResourceLoaderModule.php(733): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#4 /includes/resourceloader/ResourceLoader.php(1131): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#5 /includes/resourceloader/ResourceLoader.php(838): ResourceLoader->makeModuleResponse(ResourceLoaderContext, array, array)
#6 /load.php(51): ResourceLoader->respond(ResourceLoaderContext)
#7 /load.php(38): wfLoadMain()
#8 {main}`
This extension used to be supported by twn, however this is years ago. I will be nice to have it again.
As of now, the latest stable update to Bootstrap was 5.2.3. There's also an alpha version 5.3, but it's not a priority to include it, which can still be buggy.
Bootstrap 5.2.3 release blog post: https://blog.getbootstrap.com/2022/11/22/bootstrap-5-2-3/
I've installed Mediawiki v1.34. It's running inside a docker container with a volume attached to a folder named html
.
I created the composer.local.json file as instructed and ran sudo docker run --rm --interactive --tty --volume $PWD/html:/app composer update
I've also added the required lines in the LocalSettings.php file.
The page is loading https://wiki.redacted/load.php?lang=en-ca&modules=ext.bootstrap.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector
but I cannot find, for example .alert-success
in the file.
I activated php error reporting and I see no error.
Am I missing something or this is simply not compatible with v1.34?
New requirements:
Installation instructions...
wfLoadExtension( 'Bootstrap' );
$wgHooks['SetupAfterCache'][] = function(){
\Bootstrap\BootstrapManager::getInstance()->addAllBootstrapModules();
return true;
};
$wgHooks['ParserAfterParse'][]=function( Parser &$parser, &$text, StripState &$stripState ){
$parser->getOutput()->addModuleStyles( 'ext.bootstrap.styles' );
$parser->getOutput()->addModules( 'ext.bootstrap.scripts' );
return true;
};
Now leading to...
PHP Deprecated: Use of ParserOutput::addModuleStyles with non-array argument was deprecated in MediaWiki 1.38. [Called from {closure}
PHP Deprecated: Use of ParserOutput::addModules with non-array argument was deprecated in MediaWiki 1.38. [Called from {closure}
Since MediaWiki version 1.38.2
.
Hi Stephan
I finally found the time to upgrade BootstrapComponents. Unfortunately I ran into a small problem. Maybe you can give me some pointers on where to look.
PHP 7.3
MW 1.34
MariaDB 10.3
Smw 3.1.4
Chameleon 2.1.0
Bootstrap 4.0 (8736060)
SCSS 1.0 (5cf8c1c)
Compilation of bootstrap styles by the scss extension produces an exception, mw subsequently is missing all the bootstrap styles.
as suggested by the documentation (which is great, by the way, thanks!)
'ParserAfterParse' => function( Parser &$parser, &$text, \StripState &$stripState ){
$parser->getOutput()->addModules( 'ext.bootstrap.styles' );
$parser->getOutput()->addModules( 'ext.bootstrap.scripts' );
return true;
},
'SetupAfterCache' => function() {
BootstrapManager::getInstance()->addAllBootstrapModules();
return true;
},
It makes no difference if I first load the skin or the extension.
contains
/* SCSS compile error: expecting color, function received: <path to mw>/skins/chameleon/resources/styles/_variables.scss on line 36*/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.