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: preg_match(): Argument #2 ($subject) must be of type string, array given #226

Open
krabina opened this issue May 14, 2024 · 2 comments
Labels

Comments

@krabina
Copy link
Contributor

krabina commented May 14, 2024

Setup and configuration

  • SMW version: 4.1.3
  • SESP version: 3.0.5
  • MW version: 1.39.7
  • PHP version: 8
  • DB (MySQL etc. and version):

Issue

rebuildData.php produces an error on some pages:

TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given
Backtrace:
from 
* /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(203)
#0  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(203): preg_match()
#1  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(178): SESP\PropertyAnnotators\ExifPropertyAnnotator->convertExifDate()
#2  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(169): SESP\PropertyAnnotators\ExifPropertyAnnotator->makeDataItemTime()
#3  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(141): SESP\PropertyAnnotators\ExifPropertyAnnotator->createDataItemFromExif()
#4  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(113): SESP\PropertyAnnotators\ExifPropertyAnnotator->addExifDataTo()
#5  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/ExifPropertyAnnotator.php(100): SESP\PropertyAnnotators\ExifPropertyAnnotator->getDataItemFromExifData()
#6  /extensions/SemanticExtraSpecialProperties/src/PropertyAnnotators/DispatchingPropertyAnnotator.php(73): SESP\PropertyAnnotators\ExifPropertyAnnotator->addAnnotation()
#7  /extensions/SemanticExtraSpecialProperties/src/ExtraPropertyAnnotator.php(72): SESP\PropertyAnnotators\DispatchingPropertyAnnotator->addAnnotation()
#8  /extensions/SemanticExtraSpecialProperties/src/HookRegistry.php(178): SESP\ExtraPropertyAnnotator->addAnnotation()
#9  /includes/HookContainer/HookContainer.php(338): SESP\HookRegistry->SESP\{closure}()
#10  /includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#11  /extensions/SemanticMediaWiki/src/Store.php(235): MediaWiki\HookContainer\HookContainer->run()
#12  /extensions/SemanticMediaWiki/src/DataUpdater.php(420): SMW\Store->updateData()
#13  /extensions/SemanticMediaWiki/src/DataUpdater.php(297): SMW\DataUpdater->updateData()
#14  /extensions/SemanticMediaWiki/src/DataUpdater.php(197): SMW\DataUpdater->runUpdate()
#15  /extensions/SemanticMediaWiki/src/ParserData.php(469): SMW\DataUpdater->doUpdate()
#16  /extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(305): SMW\ParserData->updateStore()
#17  /extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(218): SMW\MediaWiki\Jobs\UpdateJob->updateStore()
#18  /extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(139): SMW\MediaWiki\Jobs\UpdateJob->parse_content()
#19  /extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(94): SMW\MediaWiki\Jobs\UpdateJob->doUpdate()
#20  /extensions/SemanticMediaWiki/src/SQLStore/Rebuilder/Rebuilder.php(247): SMW\MediaWiki\Jobs\UpdateJob->run()
#21  /extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(472): SMW\SQLStore\Rebuilder\Rebuilder->rebuild()
#22  /extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(385): SMW\Maintenance\DataRebuilder->doUpdateById()
#23  /extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(224): SMW\Maintenance\DataRebuilder->rebuildAll()
#24  /extensions/SemanticMediaWiki/maintenance/rebuildData.php(198): SMW\Maintenance\DataRebuilder->rebuild()
#25  /maintenance/includes/MaintenanceRunner.php(309): SMW\Maintenance\rebuildData->execute()
#26  /maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run()
#27  /extensions/SemanticMediaWiki/maintenance/rebuildData.php(294): require_once(string)
#28 {main}

Steps to reproduce the observation (recommendation is to use the sandbox):

@krabina krabina added the bug label May 14, 2024
@krabina
Copy link
Contributor Author

krabina commented May 14, 2024

the --ignore-exceptions option does not work in this case

@kghbln
Copy link
Member

kghbln commented May 19, 2024

I can confirm this for the following setup:

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

2 participants