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

Argument 2 passed to SMW\ApprovedRevs\Hooks::onChangeRevision() must be an instance of Revision or null #27

Closed
gesinn-it-gea opened this issue Mar 9, 2022 · 1 comment · Fixed by #28
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gesinn-it-gea
Copy link
Member

Setup and configuration

  • SMW version: 4.0.0
  • AR: 1.7.3
  • SAR version: 0.9.1
  • MW version: 1.35
  • DB (MySQL etc.): MySQL

Issue

Produces an Internal Error on approve

[247416eeaad4471190c0c8c5] /index.php?title=Main_Page&action=approve&oldid=1 TypeError from line 172 of /var/www/html/extensions/SemanticApprovedRevs/src/Hooks.php: Argument 2 passed to SMW\ApprovedRevs\Hooks::onChangeRevision() must be an instance of Revision or null, instance of MediaWiki\Revision\RevisionStoreRecord given, called in /var/www/html/includes/HookContainer/HookContainer.php on line 329

Backtrace:

#0 /var/www/html/includes/HookContainer/HookContainer.php(329): SMW\ApprovedRevs\Hooks->onChangeRevision(Title, MediaWiki\Revision\RevisionStoreRecord)
#1 /var/www/html/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

Steps to reproduce the observation:

  • Vanilla Wiki with default Main Page
  • Login as WikiSysop
  • Approve "Main Page"
@gesinn-it-gea gesinn-it-gea added the bug Something isn't working label Mar 9, 2022
@gesinn-it-gea gesinn-it-gea added this to the 0.9.2 milestone Mar 9, 2022
@gesinn-it-wam
Copy link
Contributor

gesinn-it-wam added a commit that referenced this issue Mar 15, 2022
* add integration test to demonstrate #27
* fix #27 by updating the signature of Hooks::onChangeRevision
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

Successfully merging a pull request may close this issue.

2 participants