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

SESP breaks Resource Loader #129

Closed
alex-mashin opened this issue Nov 6, 2019 · 10 comments
Closed

SESP breaks Resource Loader #129

alex-mashin opened this issue Nov 6, 2019 · 10 comments
Labels

Comments

@alex-mashin
Copy link
Collaborator

Setup and configuration

Product Version License Description Authors
Semantic MediaWiki 3.1.0 GPL-2.0-or-later Делает вашу вики более доступной — для машин и людей (документация в сети) Markus Krötzsch, Jeroen De Dauw, James Hong Kong и другие
Semantic Extra Special Properties 2.0.0 GPL-2.0-or-later Добавляет некоторые дополнительные специальные свойства для всех страниц James Hong Kong, Leo Wallentin и другие
Product Version
MediaWiki 1.31.3 (8af9c78)01:21, 5 ноября 2019
PHP 7.2.24-0ubuntu0.18.04.1 (fpm-fcgi)
MariaDB 10.3.18-MariaDB-1:10.3.18+maria~bionic-log

Issue

When I was trying to investigate why Semantic Glossary stopped to produce popups after upgrading to SMW 3.1, I found in my browser console:

[7cf91b206d0c705d1e3a9f13] /w/load.php?debug=false&lang=ru&modules=startup&only=scripts&skin=timeless   BadMethodCallException from line 848 of /var/www/wiki/w/includes/session/SessionManager.php: Sessions are disabled for this entry point
Backtrace:
#0 /var/www/wiki/w/includes/session/SessionManager.php(196): MediaWiki\Session\SessionManager->getSessionFromInfo(MediaWiki\Session\SessionInfo, WebRequest)
#1 /var/www/wiki/w/includes/WebRequest.php(736): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)
#2 /var/www/wiki/w/includes/user/User.php(1350): WebRequest->getSession()
#3 /var/www/wiki/w/includes/user/User.php(449): User->loadFromSession()
#4 /var/www/wiki/w/includes/user/User.php(5411): User->load()
#5 /var/www/wiki/w/includes/user/User.php(3101): User->loadOptions()
#6 /var/www/wiki/w/includes/context/RequestContext.php(336): User->getOption(string)
#7 /var/www/wiki/w/includes/StubObject.php(206): RequestContext->getLanguage()
#8 /var/www/wiki/w/includes/StubObject.php(168): StubUserLang->_newObject()
#9 /var/www/wiki/w/includes/StubObject.php(111): StubObject->_unstub(string, integer)
#10 /var/www/wiki/w/includes/StubObject.php(138): StubObject->_call(string, array)

#11 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/AppFactory.php(136): StubObject->__call(string, array)

#12 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/PropertyRegistry.php(43): SESP\AppFactory->getPropertyDefinitions()
#13 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/HookRegistry.php(144): SESP\PropertyRegistry->register(SMW\PropertyRegistry)
#14 /var/www/wiki/w/includes/Hooks.php(177): SESP\HookRegistry->SESP\{closure}(SMW\PropertyRegistry)
#15 /var/www/wiki/w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#16 /var/www/wiki/w/extensions/SemanticMediaWiki/src/PropertyRegistry.php(507): Hooks::run(string, array)
#17 /var/www/wiki/w/extensions/SemanticMediaWiki/src/PropertyRegistry.php(98): SMW\PropertyRegistry->initProperties(array)
#18 /var/www/wiki/w/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php(94): SMW\PropertyRegistry::getInstance()
#19 /var/www/wiki/w/extensions/SemanticMediaWiki/src/DataItemFactory.php(45): SMW\DIProperty->__construct(string, boolean)
#20 /var/www/wiki/w/extensions/SemanticMediaWiki/src/Property/Annotators/EditProtectedPropertyAnnotator.php(71): SMW\DataItemFactory->newDIProperty(string)
#21 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(208): SMW\Property\Annotators\EditProtectedPropertyAnnotator->addTopIndicatorTo(ParserOutput)
#22 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(170): SMW\MediaWiki\Hooks\ParserAfterTidy->addPropertyAnnotations(SMW\Property\AnnotatorFactory, SMW\SemanticData)
#23 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(96): SMW\MediaWiki\Hooks\ParserAfterTidy->performUpdate(string)
#24 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(359): SMW\MediaWiki\Hooks\ParserAfterTidy->process(string)
#25 /var/www/wiki/w/includes/Hooks.php(177): SMW\MediaWiki\Hooks->onParserAfterTidy(Parser, string)
#26 /var/www/wiki/w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#27 /var/www/wiki/w/includes/parser/Parser.php(1428): Hooks::run(string, array)
#28 /var/www/wiki/w/includes/parser/Parser.php(446): Parser->internalParseHalfParsed(string, boolean, boolean)
#29 /var/www/wiki/w/includes/cache/MessageCache.php(1162): Parser->parse(string, Title, ParserOptions, boolean)
#30 /var/www/wiki/w/includes/Message.php(1244): MessageCache->parse(string, Title, boolean, boolean, Language)
#31 /var/www/wiki/w/includes/Message.php(869): Message->parseText(string)
#32 /var/www/wiki/w/includes/Message.php(922): Message->toString(string)
#33 /var/www/wiki/w/extensions/VisualEditor/includes/VisualEditorDataModule.php(30): Message->parse()
#34 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(706): VisualEditorDataModule->getScript(DerivativeResourceLoaderContext)
#35 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(674): ResourceLoaderModule->buildContent(DerivativeResourceLoaderContext)
#36 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(828): ResourceLoaderModule->getModuleContent(DerivativeResourceLoaderContext)
#37 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(665): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
#38 [internal function]: ResourceLoader->{closure}(string)
#39 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(678): array_map(Closure, array)
#40 /var/www/wiki/w/includes/resourceloader/ResourceLoaderStartUpModule.php(449): ResourceLoader->getCombinedVersion(DerivativeResourceLoaderContext, array)
#41 /var/www/wiki/w/includes/resourceloader/ResourceLoaderStartUpModule.php(422): ResourceLoaderStartUpModule->getAllModuleHashes(DerivativeResourceLoaderContext)
#42 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(831): ResourceLoaderStartUpModule->getDefinitionSummary(DerivativeResourceLoaderContext)
#43 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(665): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)
#44 [internal function]: ResourceLoader->{closure}(string)
#45 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(678): array_map(Closure, array)
#46 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(759): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)
#47 /var/www/wiki/w/load.php(51): ResourceLoader->respond(ResourceLoaderContext)
#48 {main}
@alex-mashin
Copy link
Collaborator Author

It seems to me that the problem is caused by MediaWiki's trying to insert parsed messages in user's language into JavaScript, which is supposed not to include any user-, and therefore, session-dependant data.

I presume that PHP code that forms JavaScript files for ResourceLoader must not refer to $wgLang as SemanticExtraSpecialProperties/src/AppFactory.php does in line 136. However, I am not now sure, which extension to blame: SESP or VisualEditor (version 1.31 im my setup).

@mwjames

This comment has been minimized.

@mwjames
Copy link
Contributor

mwjames commented Jan 12, 2020

Expected to be solved by SemanticMediaWiki/SemanticMediaWiki#4400 (see comment).

@mwjames mwjames closed this as completed Jan 12, 2020
@alex-mashin
Copy link
Collaborator Author

Under SMW 3.1.3, MW 1.34.0 the glossary popups are back.

@kghbln
Copy link
Member

kghbln commented Feb 9, 2020

Under SMW 3.1.3, MW 1.34.0 the glossary popups are back.

I guess because the fix will be served with 3.2.0. Could you point to an example on sandbox. Currently I do not find "black beauty".

@alex-mashin
Copy link
Collaborator Author

It seems that I closed this bug too early, because I confused it with a bug in Semantic Glossary. The error is still observed under MW 1.34.2, SESP 2.0.0. SMW 3.1.3.

[c66501a48df2cf3bbf04a5ee] /w/load.php?lang=ru&modules=startup&only=scripts&raw=1&skin=timeless   BadMethodCallException from line 826 of /var/www/wiki/w/includes/session/SessionManager.php: Sessions are disabled for this entry point
Backtrace:
#0 /var/www/wiki/w/includes/session/SessionManager.php(196): MediaWiki\Session\SessionManager->getSessionFromInfo()
#1 /var/www/wiki/w/includes/WebRequest.php(806): MediaWiki\Session\SessionManager->getSessionForRequest()
#2 /var/www/wiki/w/includes/user/User.php(1299): WebRequest->getSession()
#3 /var/www/wiki/w/includes/user/User.php(374): User->loadFromSession()
#4 /var/www/wiki/w/includes/user/User.php(5130): User->load()
#5 /var/www/wiki/w/includes/user/User.php(2966): User->loadOptions()
#6 /var/www/wiki/w/includes/context/RequestContext.php(344): User->getOption()
#7 /var/www/wiki/w/includes/StubUserLang.php(52): RequestContext->getLanguage()
#8 /var/www/wiki/w/includes/StubObject.php(168): StubUserLang->_newObject()
#9 /var/www/wiki/w/includes/StubObject.php(111): StubObject->_unstub()
#10 /var/www/wiki/w/includes/StubObject.php(138): StubObject->_call()
#11 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/AppFactory.php(136): StubObject->__call()
#12 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/PropertyRegistry.php(43): SESP\AppFactory->getPropertyDefinitions()
#13 /var/www/wiki/w/extensions/SemanticExtraSpecialProperties/src/HookRegistry.php(144): SESP\PropertyRegistry->register()
#14 /var/www/wiki/w/includes/Hooks.php(174): SESP\HookRegistry->SESP\{closure}()
#15 /var/www/wiki/w/includes/Hooks.php(202): Hooks::callHook()
#16 /var/www/wiki/w/extensions/SemanticMediaWiki/src/PropertyRegistry.php(507): Hooks::run()
#17 /var/www/wiki/w/extensions/SemanticMediaWiki/src/PropertyRegistry.php(98): SMW\PropertyRegistry->initProperties()
#18 /var/www/wiki/w/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php(94): SMW\PropertyRegistry::getInstance()
#19 /var/www/wiki/w/extensions/SemanticMediaWiki/src/DataItemFactory.php(45): SMW\DIProperty->__construct()
#20 /var/www/wiki/w/extensions/SemanticMediaWiki/src/Property/Annotators/EditProtectedPropertyAnnotator.php(71): SMW\DataItemFactory->newDIProperty()
#21 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(208): SMW\Property\Annotators\EditProtectedPropertyAnnotator->addTopIndicatorTo()
#22 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(169): SMW\MediaWiki\Hooks\ParserAfterTidy->addPropertyAnnotations()
#23 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/ParserAfterTidy.php(96): SMW\MediaWiki\Hooks\ParserAfterTidy->performUpdate()
#24 /var/www/wiki/w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(359): SMW\MediaWiki\Hooks\ParserAfterTidy->process()
#25 /var/www/wiki/w/includes/Hooks.php(174): SMW\MediaWiki\Hooks->onParserAfterTidy()
#26 /var/www/wiki/w/includes/Hooks.php(202): Hooks::callHook()
#27 /var/www/wiki/w/includes/parser/Parser.php(1617): Hooks::run()
#28 /var/www/wiki/w/includes/parser/Parser.php(596): Parser->internalParseHalfParsed()
#29 /var/www/wiki/w/includes/cache/MessageCache.php(1243): Parser->parse()
#30 /var/www/wiki/w/includes/language/Message.php(1251): MessageCache->parse()
#31 /var/www/wiki/w/includes/language/Message.php(879): Message->parseText()
#32 /var/www/wiki/w/includes/language/Message.php(932): Message->toString()
#33 /var/www/wiki/w/extensions/VisualEditor/includes/VisualEditorDataModule.php(30): Message->parse()
#34 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(719): VisualEditorDataModule->getScript()
#35 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(687): ResourceLoaderModule->buildContent()
#36 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(822): ResourceLoaderModule->getModuleContent()
#37 /var/www/wiki/w/includes/resourceloader/ResourceLoaderStartUpModule.php(283): ResourceLoaderModule->getVersionHash()
#38 /var/www/wiki/w/includes/resourceloader/ResourceLoaderStartUpModule.php(468): ResourceLoaderStartUpModule->getModuleRegistrations()
#39 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(719): ResourceLoaderStartUpModule->getScript()
#40 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(687): ResourceLoaderModule->buildContent()
#41 /var/www/wiki/w/includes/resourceloader/ResourceLoaderModule.php(822): ResourceLoaderModule->getModuleContent()
#42 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(665): ResourceLoaderModule->getVersionHash()
#43 [internal function]: ResourceLoader->{closure}()
#44 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(677): array_map()
#45 /var/www/wiki/w/includes/resourceloader/ResourceLoader.php(764): ResourceLoader->getCombinedVersion()
#46 /var/www/wiki/w/load.php(48): ResourceLoader->respond()
#47 {main}

@kghbln
Copy link
Member

kghbln commented Feb 14, 2020

It seems that I closed this bug too early, because I confused it with a bug in Semantic Glossary. The error is still observed under MW 1.34.2, SESP 2.0.0. SMW 3.1.3.

I guess because the fix will be served with 3.2.0. Could you point to an example on sandbox. Currently I do not find "black beauty".

@alex-mashin
Copy link
Collaborator Author

alex-mashin commented Feb 14, 2020

I applied the patch https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4400/files manually and the error went away.

Currently I do not find "black beauty".

What do you mean by the "black beauty"?

@kghbln
Copy link
Member

kghbln commented Feb 14, 2020

What do you mean by the "black beauty"?

Didn't you say that the popups or so went black because of this reason. Could also be that I misread something somewhere.

I applied the patch https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4400/files manually and the error went away.

Thanks for testing. Probably worth back-porting. I will ask.

@alex-mashin
Copy link
Collaborator Author

alex-mashin commented Feb 14, 2020

What do you mean by the "black beauty"?

Didn't you say that the popups or so went black because of this reason. Could also be that I misread something somewhere.

Semantic glossary normally produces popups, which used to be black, if I remember correctly; and they disappeared due to some other bug that I confused with this one. That bug is now corrected: I applied the patch manually as well.

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

No branches or pull requests

4 participants