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

TypeError from line 61 of "ImageCaption.php": Argument 3 passed to SMW\ImageCaption\ImageCaption::modifyCaption() must be of the type string, null given #9

Open
kghbln opened this issue Aug 23, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@kghbln
Copy link
Member

kghbln commented Aug 23, 2020

Setup and configuration

  • MediaWiki | 1.35.0-rc.2 (37ef236)17:21, 22 August 2020
  • PHP | 7.2.24-0ubuntu0.18.04.6 (apache2handler)
  • MariaDB | 10.1.44-MariaDB-0ubuntu0.18.04.1
  • Semantic MediaWiki | 3.2.0-alpha (127a703) 14:33, 22 August 2020
  • Semantic Image Caption | 1.0.0-alpha (e0ea278) 15:27, 9 August 2020
  • Title Icon | 4.1.1 (2e9ce16) 08:11, 11 July 2020

Issue

[1c6686c5076d115b475b6a2d] /wiki/Cat%C3%A9gorie:Title_Icon_example TypeError from line 61 of /../w/extensions/SemanticImageCaption/src/ImageCaption.php: Argument 3 passed to SMW\ImageCaption\ImageCaption::modifyCaption() must be of the type string, null given, called in /../w/extensions/SemanticImageCaption/src/Hooks.php on line 98

This was not caused by the recent update to MW 1.35.x. It just happens that I only now had a look at the logs and reported it.

Backtrace

#0 /../w/extensions/SemanticImageCaption/src/Hooks.php(98): SMW\ImageCaption\ImageCaption->modifyCaption(Title, LocalFile, NULL, string)
#1 /../w/includes/HookContainer/HookContainer.php(320): SMW\ImageCaption\Hooks::onImageBeforeProduceHTML(DummyLinker, Title, LocalFile, array, array, boolean, NULL, Parser, string, NULL)
#2 /../w/includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /../w/includes/HookContainer/HookRunner.php(2082): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /../w/includes/Linker.php(308): MediaWiki\HookContainer\HookRunner->onImageBeforeProduceHTML(DummyLinker, Title, LocalFile, array, array, boolean, NULL, Parser, string, NULL)
#5 /../w/extensions/TitleIcon/TitleIcon.php(201): Linker::makeImageLink(Parser, Title, LocalFile, array, array)
#6 /../w/extensions/TitleIcon/TitleIcon.php(138): TitleIcon->getIconHTML()
#7 /../w/extensions/TitleIcon/TitleIcon.php(74): TitleIcon->handlePageTitle(OutputPage)
#8 /../w/includes/HookContainer/HookContainer.php(320): TitleIcon::showIconInPageTitle(OutputPage, SkinVector)
#9 /../w/includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#10 /../w/includes/HookContainer/HookRunner.php(997): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#11 /../w/includes/OutputPage.php(2610): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay(OutputPage, SkinVector)
#12 /../w/includes/MediaWiki.php(947): OutputPage->output(boolean)
#13 /../w/includes/MediaWiki.php(960): MediaWiki->{closure}()
#14 /../w/includes/MediaWiki.php(543): MediaWiki->main()
#15 /../w/index.php(53): MediaWiki->run()
#16 /../w/index.php(46): wfIndexMain()
#17 {main}

Steps to reproduce the observation (recommendation is to use the sandbox):
See Category:Title Icon example

@kghbln kghbln added the bug Something isn't working label Aug 23, 2020
@kghbln
Copy link
Member Author

kghbln commented Aug 23, 2020

@cicalese I am not sure if this comes from SIC or TI. If you think TI needs to be fixed pls tell me to open an issue in Phabricator. Thanks a ton!

@cicalese
Copy link

cicalese commented Sep 3, 2020

The argument that is null is $frameParams['caption']. TitleIcon does not set a caption on the linked images it puts in the title bar. I'm not familiar with SemanticImageCaption, but it seems that it should check for the existence of the caption frame parameter before setting it at https://github.com/SemanticMediaWiki/SemanticImageCaption/blob/master/src/Hooks.php#L98.

@kghbln
Copy link
Member Author

kghbln commented Sep 4, 2020

@cicalese Thank you for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants