Forum:I can't use templatestyles features

ShoutWiki — express yourself and be heard!
Jump to navigation Jump to search

Forums: Index Community help

I saw that mw:Extension:TemplateStyles have been installed and want to use it. But when try to create "Template:foo/style.css" or change content model from other than sanitized CSS to it, display following error log and couldn't do these action. Is there something wrong with it? Thank you.--Kkairri (talk) 13:45, 20 June 2019 (UTC)

[e8ac890b842dec5872691c89] /wiki/%E7%89%B9%E5%88%A5:ChangeContentModel/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88:Hakomap/styles Error from line 76 of /var/www/live/w/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /var/www/live/w/extensions/TemplateStyles/includes/TemplateStylesContent.php(131): TemplateStylesContent->sanitize(array)
#1 /var/www/live/w/includes/Revision/RenderedRevision.php(242): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#2 /var/www/live/w/includes/Revision/RenderedRevision.php(211): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)
#3 /var/www/live/w/includes/Revision/RevisionRenderer.php(175): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#4 /var/www/live/w/includes/Revision/RevisionRenderer.php(128): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#5 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#6 /var/www/live/w/includes/Revision/RenderedRevision.php(175): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#7 /var/www/live/w/includes/Storage/DerivedPageDataUpdater.php(1265): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#8 /var/www/live/w/includes/Storage/DerivedPageDataUpdater.php(1235): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#9 /var/www/live/w/includes/page/WikiPage.php(1994): MediaWiki\Storage\DerivedPageDataUpdater->getPreparedEdit()
#10 /var/www/live/w/extensions/SpamBlacklist/includes/SpamBlacklistHooks.php(31): WikiPage->prepareContentForEdit(TemplateStylesContent)
#11 /var/www/live/w/includes/Hooks.php(174): SpamBlacklistHooks::filterMergedContent(DerivativeContext, TemplateStylesContent, Status, string, User, boolean)
#12 /var/www/live/w/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#13 /var/www/live/w/includes/specials/SpecialChangeContentModel.php(248): Hooks::run(string, array)
#14 /var/www/live/w/includes/htmlform/HTMLForm.php(665): SpecialChangeContentModel->onSubmit(array, OOUIHTMLForm)
#15 /var/www/live/w/includes/htmlform/HTMLForm.php(557): HTMLForm->trySubmit()
#16 /var/www/live/w/includes/htmlform/HTMLForm.php(572): HTMLForm->tryAuthorizedSubmit()
#17 /var/www/live/w/includes/specialpage/FormSpecialPage.php(184): HTMLForm->show()
#18 /var/www/live/w/includes/specialpage/SpecialPage.php(569): FormSpecialPage->execute(string)
#19 /var/www/live/w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(string)
#20 /var/www/live/w/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#21 /var/www/live/w/includes/MediaWiki.php(860): MediaWiki->performRequest()
#22 /var/www/live/w/includes/MediaWiki.php(517): MediaWiki->main()
#23 /var/www/live/w/index.php(42): MediaWiki->run()
#24 {main}

Content on "Template:Hakomap"

<templatestyles src="Template:Hakomap/styles.css" />
{| class="wikitable"
|-
| class="hakomapCo" | || colspan="2" class="hakomapT" | || colspan="2" class="hakomapT" | 
|-
| class="hakomapS" | 
| colspan="2" class="hakomapCe" |  || colspan="2" class="hakomapCe" | 
|-
|}

Content on "Template:Hakomap/style.css" (couldn't create)

.hakomapCo {
	width: 1em;
	height: 1em;
	padding:0;
}

.hakomapT {
	width: 2em;
	height: 1em;
	padding:0;
}

.hakomapS {
	width: 1em;
	height: 2em;
	padding:0;
}

.hakomapCe {
	width: 2em;
	height: 2em;
	padding: 0;
}
It looks like a bug in the extension, maybe a missing dependence, that is unable to change (or support) the "Sanitized CSS" content model. I suggest filing a bug report in ShoutWiki's phabricator. --Saftzie (talk) 20:02, 20 June 2019 (UTC)
I don't really know what that extension is enabled globally. Wikis survived for a long time before it without it, but, I believe the issue was missing composer dependencies. It works now, I think? --Lewis Cawte (talk) ShoutWiki Staff 11:02, 22 June 2019 (UTC)