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

Protecting page will throw exception #30

Closed
gslin opened this issue Aug 16, 2018 · 5 comments
Closed

Protecting page will throw exception #30

gslin opened this issue Aug 16, 2018 · 5 comments

Comments

@gslin
Copy link

gslin commented Aug 16, 2018

In MediaWiki 1.31 (PHP 7.2), when we try to protect a page, it will throw exception:

Backtrace:

#0 /srv/wiki.plurk.info/public/includes/Hooks.php(177): SlackNotifications::slack_article_protected(WikiPage, User, array, string)
#1 /srv/wiki.plurk.info/public/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#2 /srv/wiki.plurk.info/public/includes/page/WikiPage.php(2521): Hooks::run(string, array)
#3 /srv/wiki.plurk.info/public/includes/page/Article.php(2593): WikiPage->doUpdateRestrictions(array, array, boolean, string, User)
#4 /srv/wiki.plurk.info/public/includes/ProtectionForm.php(312): Article->doUpdateRestrictions(array, array, boolean, string, User)
#5 /srv/wiki.plurk.info/public/includes/ProtectionForm.php(187): ProtectionForm->save()
#6 /srv/wiki.plurk.info/public/includes/page/Article.php(1544): ProtectionForm->execute()
#7 /srv/wiki.plurk.info/public/includes/actions/ProtectAction.php(52): Article->protect()
#8 /srv/wiki.plurk.info/public/includes/MediaWiki.php(500): ProtectAction->show()
#9 /srv/wiki.plurk.info/public/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#10 /srv/wiki.plurk.info/public/includes/MediaWiki.php(861): MediaWiki->performRequest()
#11 /srv/wiki.plurk.info/public/includes/MediaWiki.php(524): MediaWiki->main()
#12 /srv/wiki.plurk.info/public/index.php(42): MediaWiki->run()
#13 {main}
@kulttuuri
Copy link
Owner

kulttuuri commented Aug 16, 2018 via email

@gslin
Copy link
Author

gslin commented Aug 16, 2018

Currently only protecting page (in my environment) will cause this exception.

btw, I noticed that push_slack_notify() in slack_article_protected() also has problem:

                self::push_slack_notify($message, $user);

And function push_slack_notify() is:

        static function push_slack_notify($message, $bgColor, $user)

Thanks,

@kulttuuri
Copy link
Owner

kulttuuri commented Aug 28, 2018

Good catch on that function call! I've changed couple lines of code, can you check if it still throws the error?

@gslin
Copy link
Author

gslin commented Aug 29, 2018

Thanks, it works now :-)

@kulttuuri
Copy link
Owner

Fantastic! Closing :)

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

No branches or pull requests

2 participants