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

Fix configuration #18

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

redbluegreenhat
Copy link
Contributor

Fixes an error introduced in my PR (#15)

Fixes an error introduced in my PR (immewnity#15)
@redbluegreenhat redbluegreenhat marked this pull request as draft January 28, 2024 10:54
@redbluegreenhat
Copy link
Contributor Author

I came across more issues caused by my PR on an install with this and a ported version of #14

Config is not working correctly:

Original exception: [3b6b5bb628999c94f0e5bfad] /mediawiki/mediawiki-1.41.0/index.php/Special:Preferences TypeError: FluentTemplate::getGravatarUrl(): Argument #1 ($disableGravatar) must be of type bool, array given, called in /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php on line 38
Backtrace:
from /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php(314)
#0 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php(38): FluentTemplate->getGravatarUrl()
#1 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/skins/SkinTemplate.php(148): FluentTemplate->execute()
#2 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/skins/SkinTemplate.php(174): SkinTemplate->generateHTML()
#3 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/Output/OutputPage.php(2947): SkinTemplate->outputPage()
#4 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/MediaWiki.php(978): MediaWiki\Output\OutputPage->output()
#5 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/MediaWiki.php(613): MediaWiki->main()
#6 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/index.php(50): MediaWiki->run()
#7 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/index.php(46): wfIndexMain()
#8 {main}

Exception caught inside exception handler: [3b6b5bb628999c94f0e5bfad] /mediawiki/mediawiki-1.41.0/index.php/Special:Preferences TypeError: FluentTemplate::getGravatarUrl(): Argument #1 ($disableGravatar) must be of type bool, array given, called in /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php on line 38
Backtrace:
from /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php(314)
#0 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/skins/Fluent/includes/FluentTemplate.php(38): FluentTemplate->getGravatarUrl()
#1 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/skins/SkinTemplate.php(148): FluentTemplate->execute()
#2 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/skins/SkinTemplate.php(174): SkinTemplate->generateHTML()
#3 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/Output/OutputPage.php(2947): SkinTemplate->outputPage()
#4 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/exception/MWExceptionRenderer.php(188): MediaWiki\Output\OutputPage->output()
#5 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/exception/MWExceptionRenderer.php(105): MWExceptionRenderer::reportHTML()
#6 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/exception/MWExceptionHandler.php(134): MWExceptionRenderer::output()
#7 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/exception/MWExceptionHandler.php(251): MWExceptionHandler::report()
#8 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/includes/MediaWiki.php(635): MWExceptionHandler::handleException()
#9 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/index.php(50): MediaWiki->run()
#10 /var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/index.php(46): wfIndexMain()
#11 {main}

eval gives this:

/var/www/localhost/htdocs/mediawiki/mediawiki-1.41.0/maintenance # php eval.php

*******************************************************************************
NOTE: Do not run maintenance scripts directly, use maintenance/run.php instead!
      Running scripts directly has been deprecated in MediaWiki 1.40.
      It may not work for some (or any) scripts in the future.
*******************************************************************************

> $skinConfig = MediaWiki\MediaWikiServices::getInstance()->getConfigFactory()->makeConfig('Fluent');

> var_dump($skinConfig)
object(MediaWiki\Config\GlobalVarConfig)#19 (1) {
  ["prefix":"MediaWiki\Config\GlobalVarConfig":private]=>
  string(2) "wg"
}

> var_dump($skinConfig->get('FluentDisableGravatar'))
array(2) {
  ["value"]=>
  bool(false)
  ["help"]=>
  string(116) "Control whether or not we should use Gravatar. You should set this to true for wikis not available over the internet"
}

I'll fix this on this PR also.

@redbluegreenhat redbluegreenhat changed the title use the GlobalVarConfig registry Fix configuration Jan 28, 2024
@redbluegreenhat
Copy link
Contributor Author

I'm not sure how to fix this, it may be best to revert #15 and try again later.

I've been looking at how Vector does configuration, they don't have a ConfigRegistry in their skin.json, they use MediaWiki\MediaWikiServices::getInstance->getMainConfig(), and just get the configs and it works, somehow.

immewnity added a commit that referenced this pull request Jan 29, 2024
Fix getGravatarUrl function (#18)
immewnity added a commit that referenced this pull request Jan 29, 2024
immewnity added a commit that referenced this pull request Jan 29, 2024
Revert "Fix getGravatarUrl function (#18)"
@immewnity immewnity marked this pull request as ready for review January 29, 2024 03:11
@immewnity immewnity merged commit 893afe2 into immewnity:main Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants