Giter Club home page Giter Club logo

bootstrap's People

Contributors

cicalese avatar dependabot[bot] avatar jeroendedauw avatar kghbln avatar malberts avatar mwjames avatar nemobis avatar oetterer avatar paladox avatar pierreboutet avatar reedy avatar s7eph4n avatar siebrand avatar translatewiki avatar universal-omega avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bootstrap's Issues

Fatal error on MW 1.29.0

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.

SCSS compile error with scssphp 1.5.0

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:

  • MediaWiki: 1.35.2
  • SCSS library: 2.0.5
  • Bootstrap extension: 4.5.0 (= Bootstrap library 4.6.0)
  • Chameleon skin: master

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:
image

When loading the page with ?debug=true an error can be seen in the Bootstrap/Chameleon CSS:
image
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*/

Installation

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

Bootstrap 4.5.x

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.

composer phpcs: This file is part of the MediaWiki extension Bootstrap, it is not a valid entry point.

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.

RuntimeException on empty $wgScriptPath

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}

problems with modal backdrop z-index on various skins

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/

Support installing without composer

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

Requirements version conflict with MediaWiki Core

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.

[1] wikimedia/mediawiki@021ed39

Error after Installing

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}`

Get i18n rolling again

This extension used to be supported by twn, however this is years ago. I will be nice to have it again.

bootstrap css classes not loaded in mediawiki 1.34 (standalone)

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?

Deprecate EOL MW

New requirements:

  • MW 1.35+
  • PHP: 7.4.3+ (as per MW 1.35, except 7.3 which is EOL)
  • ...TODO

ParserOutput::addModuleStyles with non-array argument was deprecated in MediaWiki 1.38

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.

need help using bootstrap extension

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.

system

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)

problem

Compilation of bootstrap styles by the scss extension produces an exception, mw subsequently is missing all the bootstrap styles.

hook registrations

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;
},

scenarios:

  1. when not loading my extension, chameleon works, all styles are loaded (style module zzz.ext.bootstrap.styles)
  2. when loading my extension network request analyse shows load.php is called for modules 'ext.bootstrap.styles' and 'zzz.ext.bootstrap.styles'. however, both contain the error message shown below.

It makes no difference if I first load the skin or the extension.

error message

https://localhost/w/load.php?debug=true&lang=en&modules=ext.bootstrap.styles&only=styles&skin=chameleon

contains

/* SCSS compile error: expecting color, function received: <path to mw>/skins/chameleon/resources/styles/_variables.scss on line 36*/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.