Coder Social home page Coder Social logo

semanticmediawiki / semanticwatchlist Goto Github PK

View Code? Open in Web Editor NEW
8.0 17.0 9.0 758 KB

Provides a watchlist and notifier for changes to semantic properties.

Home Page: https://www.mediawiki.org/wiki/Extension:Semantic_Watchlist

License: Other

PHP 90.89% CSS 0.59% JavaScript 7.37% Shell 1.15%
watchlist smw mediawiki semantic-mediawiki semantic swl mw

semanticwatchlist's Introduction

Semantic Watchlist

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Packagist download count

Semantic Watchlist (a.k.a. SWL) is an extension to Semantic MediaWiki that enables users to watch semantic properties by adding a new watchlist page (Special:SemanticWatchlist) that lists changes to these properties.

Requirements

Semantic Watchlist 1.3:

  • PHP 7.3 or above
  • MediaWiki 1.35 or above
  • Semantic MediaWiki 3.0 - 4.0
  • MySQL 5+ or SQLite 3

Semantic Watchlist 1.2:

Semantic Watchlist 1.1:

  • PHP 5.3+, including PHP 7 and HHVM
  • MediaWiki 1.19 - 1.26
  • Semantic MediaWiki 2.x (and 1.9.x)
  • MySQL 5+ or SQLite 3

Installation

The recommended way to install Semantic Watchlist is by using Composer with an entry in MediaWiki's composer.json.

{
	"require": {
		"mediawiki/semantic-watchlist": "~1.0"
	}
}
  1. From your MediaWiki installation directory, execute composer require mediawiki/semantic-watchlist:~1.0
  2. Run php maintenance/update.php from your MediaWiki installation directory to create the required database tables.
  3. Navigate to Special:Version on your wiki and verify that the package have been successfully installed.

For configuration, see the configuration documentation on MediaWiki.org.

Usage

Users can choose to follow one or more watchlist groups, which are administrator defined, and cover a set of properties and a set of pages (category, namespace, or SMW concept). Notification of changes to watched properties is also possible via email.

Features

  • A watchlist page (Special:SemanticWatchlist) listing changes to properties watched by the user.
  • Per-user optional email notification per edit that changes properties.
  • Integration with user preferences to allow users to specify which watchlist groups they want to follow, and if they want to receive emails on changes.
  • Special:WatchListConditions as administration interface for watchlist groups.
  • API module to query property changes grouped by edit for a single user.
  • API modules to add, modify and delete the watchlist groups.

Find more detailed usage documentation on MediaWiki.org. Recent changes can be found in the release notes.

Contribution and support

If you have remarks, questions, or suggestions, please send them to [email protected]. You can subscribe to this list here.

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guildline. A list of people who have made contributions in the past can be found here.

Extending Semantic Watchlist

Semantic Watchlist is in part a workflow extension, which makes it important for other SMW/MW extensions and tools to interact with it. This is possible via the hooks and API modules Semantic Watchlist provides:

API modules

  • addswlgroup an API module to add semantic watchlist groups.
  • deleteswlgroup an API module to delete semantic watchlist groups.
  • editswlgroup an API module to modify semantic watchlist groups.
  • semanticwatchlist returns a list of modified properties per page for a persons semantic watchlist.

Hooks

  • SWLBeforeEmailNotify
  • SWLBeforeEditInsert
  • SWLAfterEditInsert
  • SWLBeforeChangeSetInsert
  • SWLAfterChangeSetInsert

Tests

This extension provides unit and integration tests that are run by a continues integration platform but can also be executed using composer phpunit from the extension base directory.

License

GNU General Public License 3.0 or later

semanticwatchlist's People

Contributors

aaronschulz avatar addshore avatar anomiex avatar bawolff avatar danielwtq avatar dannys712 avatar geofbot avatar hexmode avatar jeroendedauw avatar jqnatividad avatar kghbln avatar kizule avatar krabina avatar marktraceur avatar mwjames avatar nemobis avatar nikerabbit avatar nischayn22 avatar pastakhov avatar reedy avatar s7eph4n avatar shirayuki avatar siebrand avatar tosfos avatar translatewiki avatar umherirrender avatar xsavitar avatar yaronkoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semanticwatchlist's Issues

Attributes with space in name not shown in SWL menu

More complex names of attributes are not shown in the SWL menu. Simple ones that consists of nothing but one word appear to work. Also using underscores does not help to alleviate the problem. It continues to exist.

Special:Preferences tab interface broken

With SemanticWatchlist enabled and visiting Special:Preferences I see the following message and all preferences are displayed as a single page (instead of tabbed).

Notice: Undefined variable: type in /var/www/html/w/extensions/SemanticWatchlist/src/MediaWiki/Hooks/GetPreferences.php on line 100


Notice: Undefined variable: name in /var/www/html/w/extensions/SemanticWatchlist/src/MediaWiki/Hooks/GetPreferences.php on line 102

This is on MW 1.25wmf10, SMW master, Semantic Watchlist master

Could not update the watchlist group

I'm testing:

MediaWiki 1.26alpha (REL Branch)
Semantic Watchlist 1.0 (de74a54) 12:42, 31. Jan. 2015
Semantic MediaWiki 2.3 (also in 2.2.2)

If I want to save changes on the SWL special page , I get the message pop-up : Could not update the watchlist group-Test

alert( 'Could not update the watchlist group-' + element.group.name );

Is there a cause or a solution?

But changes are accepted and saved .

PHP Fatal error: Class 'SWL\HookRegistry' not found in /home/yyy/htdocs/w/extensions/SemanticWatchlist/SemanticWatchlist.php on line 143

PHP Fatal error: Class 'SWL\HookRegistry' not found in /home/yyy/htdocs/w/extensions/SemanticWatchlist/SemanticWatchlist.php on line 143
PHP Stack trace:
PHP 1. {main}() /home/yyy/htdocs/w/maintenance/update.php:0
PHP 2. require_once() /home/yyy/htdocs/w/maintenance/update.php:206
PHP 3. require_once() /home/yyy/htdocs/w/maintenance/doMaintenance.php:97
PHP 4. call_user_func() /home/yyy/htdocs/w/includes/Setup.php:659
PHP 5. {closure:/home/yyy/htdocs/w/extensions/SemanticWatchlist/SemanticWatchlist.php:134-148}() /home/yyy/htdocs/w/includes/Setup.php:659

I downloaded the version from git and got this error once the update routine is started.

SemanticWatchlist DB error

MW 1.31.6, requires semanticwatchlist -> ~1.0 loading with composer. All watchlist tables appear to be present, but this error appears on special page. Also, breaks users preferences, example... change of skin for a logged in user. Any ideas?

Output of error:

[6460e77799b9c9363c319895] /wiki/Special:SemanticWatchlist Wikimedia\Rdbms\DBUnexpectedError from line 3692 of /home/mw-131/public_html/w/includes/libs/rdbms/database/Database.php: Wikimedia\Rdbms\Database::begin: Implicit transaction already active (from Wikimedia\Rdbms\Database::query (User::loadFromDatabase)).

Backtrace:

#0 /home/mw-131/public_html/w/extensions/SemanticWatchlist/src/TableUpdater.php(40): Wikimedia\Rdbms\Database->begin()
#1 /home/mw-131/public_html/w/extensions/SemanticWatchlist/src/MediaWiki/Hooks/UserSaveOptions.php(74): SWL\TableUpdater->updateGroupIdsForUser(integer, array)
#2 /home/mw-131/public_html/w/extensions/SemanticWatchlist/src/MediaWiki/Hooks/UserSaveOptions.php(68): SWL\MediaWiki\Hooks\UserSaveOptions->performUpdate(array)
#3 /home/mw-131/public_html/w/extensions/SemanticWatchlist/src/HookRegistry.php(75): SWL\MediaWiki\Hooks\UserSaveOptions->execute()
#4 /home/mw-131/public_html/w/includes/Hooks.php(177): SWL\HookRegistry->SWL\{closure}(User, array)
#5 /home/mw-131/public_html/w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#6 /home/mw-131/public_html/w/includes/user/User.php(5516): Hooks::run(string, array)
#7 /home/mw-131/public_html/w/includes/user/User.php(4177): User->saveOptions()
#8 /home/mw-131/public_html/w/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php(159): User->saveSettings()
#9 /home/mw-131/public_html/w/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php(74): SpecialSemanticWatchlist->registerUserView(User)
#10 /home/mw-131/public_html/w/includes/specialpage/SpecialPage.php(565): SpecialSemanticWatchlist->execute(NULL)
#11 /home/mw-131/public_html/w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#12 /home/mw-131/public_html/w/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#13 /home/mw-131/public_html/w/includes/MediaWiki.php(861): MediaWiki->performRequest()
#14 /home/mw-131/public_html/w/includes/MediaWiki.php(524): MediaWiki->main()
#15 /home/mw-131/public_html/w/index.php(42): MediaWiki->run()
#16 {main}

Undefined offset: 1 in ...\SWL_CustomTexts.php on line 62

46  SWLEmailer::notifyUser( )   ..\GroupNotify.php:133
47  SWLEmailer::getChangeListHTML( )    ..\SWL_Emailer.php:52
48  SWLEmailer::getPropertyHTML( )  ..\SWL_Emailer.php:87
49  SWLCustomTexts->getPropertyCustomText( )    ..\SWL_Emailer.php:112
50  SWLCustomTexts->initCustomTexts( )  ..\SWL_CustomTexts.php:78

Integrate with modern notifications

Since the creation of SWL several new things related to notifications have appeared in the MW world.

SWL would presumably benefit from integrating with those, and some SWL functionality can be dropped in favor of what is now provided elsewhere.

Move preferences to Semantic MediaWiki tab

So far the preferences for this extensions use a separate tab on "Special:Preferences" (mw-prefsection-swl). For consistency and for saving space it should probably be moved to the Semantic MediaWiki tab (mw-prefsection-smw) as it was done for Semantic Result Formats, too.

Notification mail has HTML formatting issues with MediaWiki 1.27+

Hi

I've noticed that notification mails are not properly created, with the current version of Mediawiki.

MediaWiki 1.27 changes to function UserMailer::send() dropped backwards compatibility with previous versions of this function, which had $replyto as the 5th argument and $contentType as the 6th.

As a result SWLEmailer::notifyUser(), when used with MediaWiki 1.27+, sends notification with incorrect MIME type.

In addition, the use on Html::element() to include the description of changes, breaks the HTML formatting, while using Html::rawElement() works correctly.

Both issues are addressed with #72

Fatal error: Call to a member function rawParams() on a non-object in /home/ccc/htdocs/w/extensions/SemanticWatchlist/includes/SWL_Emailer.php on line 43

Call Stack
Time    Memory  Function    Location
1   0.0002  260240  {main}( )   ../index.php:0
2   0.0517  6524496 MediaWiki->run( )   ../index.php:46
3   0.0517  6524952 MediaWiki->main( )  ../MediaWiki.php:435
4   0.0526  6589784 MediaWiki->performRequest( )    ../MediaWiki.php:584
5   0.0541  6648136 SpecialPageFactory::executePath( )  ../MediaWiki.php:275
6   0.0549  6723632 SpecialPage->run( ) ../SpecialPageFactory.php:584
7   0.0549  6723712 SFFormEdit->execute( )  ../SpecialPage.php:363
8   0.1162  13001448    SFFormEdit->printForm( )    ../SF_FormEdit.php:43
9   0.1267  14498080    SFAutoeditAPI->execute( )   ../SF_FormEdit.php:88
10  0.1280  14518384    SFAutoeditAPI->doAction( )  ../SF_AutoeditAPI.php:116
11  0.9077  24983424    SFAutoeditAPI->doStore( )   ../SF_AutoeditAPI.php:915
12  0.9095  24986136    EditPage->internalAttemptSave( )    ../SF_AutoeditAPI.php:462
13  0.9123  25082832    Article->doEditContent( )   ../EditPage.php:1920
14  0.9123  25083624    Article->__call( )  ../EditPage.php:1920
15  0.9123  25084064    call_user_func_array ( )    ../Article.php:2006
16  0.9123  25084872    WikiPage->doEditContent( )  ../Article.php:2006
17  1.0654  26270840    WikiPage->doEditUpdates( )  ../WikiPage.php:2026
18  1.0656  26272432    AbstractContent->getSecondaryDataUpdates( ) ../WikiPage.php:2207
19  1.0656  26272480    ParserOutput->getSecondaryDataUpdates( )    ../AbstractContent.php:232
20  1.0681  26558136    LinksUpdate->__construct( ) ../ParserOutput.php:659
21  1.0681  26563312    wfRunHooks( )   ../LinksUpdate.php:143
22  1.0681  26563360    Hooks::run( )   ../GlobalFunctions.php:3995
23  1.0682  26564456    call_user_func_array ( )    ../Hooks.php:206
24  1.0682  26564840    SMW\MediaWiki\Hooks\HookRegistry->SMW\MediaWiki\Hooks\{closure}( )  ../Hooks.php:206
25  1.0685  26583568    SMW\MediaWiki\Hooks\LinksUpdateConstructed->process( )  ../HookRegistry.php:336
26  1.0686  26584040    SMW\ParserData->updateStore( )  ../LinksUpdateConstructed.php:62
27  1.0690  26627424    SMW\StoreUpdater->doUpdate( )   ../ParserData.php:234
28  1.0692  26627712    SMW\StoreUpdater->performUpdate( )  ../StoreUpdater.php:92
29  1.0729  26687816    SMW\StoreUpdater->doRealUpdate( )   ../StoreUpdater.php:128
30  1.0729  26688080    SMW\Store->updateData( )    ../StoreUpdater.php:169
31  1.0729  26688712    wfRunHooks( )   ../SMW_Store.php:210
32  1.0729  26688760    Hooks::run( )   ../GlobalFunctions.php:3995
33  1.0733  26723248    call_user_func_array ( )    ../Hooks.php:206
34  1.0733  26723672    SWLHooks::onDataUpdate( )   ../Hooks.php:206
35  1.0856  27046648    SWLGroup->notifyWatchingUsers( )    ../SemanticWatchlist.hooks.php:54
36  1.0868  27048000    wfRunHooks( )   ../SWL_Group.php:504
37  1.0868  27048048    Hooks::run( )   ../GlobalFunctions.php:3995
38  1.0869  27049016    call_user_func_array ( )    ../Hooks.php:206
39  1.0869  27049536    SWLHooks::onGroupNotify( )  ../Hooks.php:206
40  1.0919  27113880    SWLEmailer::notifyUser( )   ../SemanticWatchlist.hooks.php:89```

Call to a member function getCount() on a non-object

From the SMW user list:

Hello List,

I am on two Wikis experiencing a problem with Semantic Watchlist 0.2.1 (one
wiki is MW 1.21.3 and SMW 1.8.0.5; the other ist MW 1.22.2 and SMW 1.9.0.1).

As soon as the page selection criteria is "concept" (rather than category
or namespace), no page can be saved any longer (actually it can be saved,
i.e. I can later observe that the changes have been committed, but it does
not load afterwords). The only exception is that it still works if the
relevant concept page does not exist. The problem occurs with any, even the
most simple concept query.

In one wiki the screen is just blank white, the other says "Fatal error:
Call to a member function getCount() on a non-object in
/var/www/wiki/extensions/SemanticWatchlist/includes/SWL_Group.php on line
436".

I still can normally load an access pages. The error occurs both while
saving with forms and by direct edits. Before I file a bug: Is anybody
around using semantic watchlist, who could try whether she/he can normally
save pages in the wiki while a semantic watchlist group is active that uses
an existing concept to select the articles to be watched?

Kind regards,
Hans
@Hans-Oleander

Notification text&format not properly working

Importing from SemanticMediaWiki/SemanticMediaWiki#211

The notification e-mail of Semantic Watchlist has problems with non-ASCII-characters, example:

Eines oder mehrere der auf MSCRM beobachteten Attribute wurden vom Benutzer Wikiadmin am 25. Februar 2014 um 12:30 Uhr geändert. Diese und andere Änderungen werden auf dieser semantischen Beobachtungsliste angezeigt.

Also the special message text if a monitored attribute changes to an expected vaule is never user (neither in the notification e-mail nor in the semantic watchlist page text).

Email notification stopped

WM/SMW system was working to email group members about pending approvals for a form. Client wanted to change terminology, using Word2 instead of Word1, in forms, templates, category added to, etc. Once I did that substitution, email notification stopped working.

The entire system works as before (form uses template, template adds to category), but email is not notifying the group.

There is a Notification Reports category which I can't find documentation for. Notification Reports for each form were created with the first system but aren't being created with the second.

In WatchlistConditions, I changed the watch to the new category and ensured it was marked in my profile.

MediaWiki 1.23.5
Semantic Watchlist 1.0 alpha (485b0be) 16:30, September 10, 2014

database error

with this extension
when i edit a page and then press save then it jumps to a database error message on the edit page
without the extension
when i edit a page and then press save then i jumps to the edited page
in both cases the page appears edited.

some how it jumps to the wrong page or database error

there was a message about
SELECT group_id,group_name,group_categories,group_namespaces,group_properties,group_concepts,group_custom_texts FROM swl_groups
with the debug option

but now with out this extension all is fine again

Database / Call to a member function recordQueryCompletion() on null

[0], best to avoid MW-master / MW 1.28 as test instance.

Using PHP 7.0.13

Semantic Watchlist: 1.2.0-alpha

Semantic MediaWiki: 2.5.0-alpha (SMWSQLStore3, mysql)
MediaWiki:          1.29.0-alpha (MediaWiki vendor autoloader)
Site language:      en

Execution time:     2016-11-24 08:04
Xdebug:             2.4.1 (enabled)

PHPUnit 3.7.38 by Sebastian Bergmann.

Configuration read from /home/travis/build/SemanticMediaWiki/mw/extensions/SemanticWatchlist/phpunit.xml.dist

...............................................................  63 / 100 ( 63%)
...................................[dad17321a2e258f6c919713d] [no req]   Error from line 957 of /home/travis/build/SemanticMediaWiki/mw/includes/libs/rdbms/database/Database.php: Call to a member function recordQueryCompletion() on null
Backtrace:
#0 /home/travis/build/SemanticMediaWiki/mw/includes/libs/rdbms/database/Database.php(870): Database->doProfiledQuery(string, string, boolean, string)
#1 /home/travis/build/SemanticMediaWiki/mw/includes/libs/rdbms/database/Database.php(2734): Database->query(string, string)
#2 /home/travis/build/SemanticMediaWiki/mw/includes/libs/rdbms/database/Database.php(2704): Database->doBegin(string)
#3 /home/travis/build/SemanticMediaWiki/mw/includes/libs/rdbms/database/Database.php(2639): Database->begin(string, string)
#4 /home/travis/build/SemanticMediaWiki/mw/extensions/SemanticWatchlist/src/TableUpdater.php(40): Database->startAtomic(string)
#5 /home/travis/build/SemanticMediaWiki/mw/extensions/SemanticWatchlist/tests/phpunit/Unit/TableUpdaterTest.php(58): SWL\TableUpdater->updateGroupIdsForUser(integer, array)
#6 [internal function]: SWL\Tests\TableUpdaterTest->testUpdateGroupIdsForUserToReplaceDatasetByUserId()
#7 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(987): ReflectionMethod->invokeArgs(SWL\Tests\TableUpdaterTest, array)
#8 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(838): PHPUnit_Framework_TestCase->runTest()
#9 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php(648): PHPUnit_Framework_TestCase->runBare()
#10 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(783): PHPUnit_Framework_TestResult->run(SWL\Tests\TableUpdaterTest)
#11 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(779): PHPUnit_Framework_TestCase->run(PHPUnit_Framework_TestResult)
#12 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(749): PHPUnit_Framework_TestSuite->runTest(SWL\Tests\TableUpdaterTest, PHPUnit_Framework_TestResult)
#13 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(707): PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult, boolean, array, array, boolean)
#14 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php(349): PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult, boolean, array, array, boolean)
#15 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(176): PHPUnit_TextUI_TestRunner->doRun(PHPUnit_Framework_TestSuite, array)
#16 /home/travis/build/SemanticMediaWiki/mw/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(array, boolean)
#17 /home/travis/build/SemanticMediaWiki/mw/tests/phpunit/phpunit.php(133): PHPUnit_TextUI_Command::main()
#18 /home/travis/build/SemanticMediaWiki/mw/maintenance/doMaintenance.php(111): PHPUnitMaintClass->execute()
#19 /home/travis/build/SemanticMediaWiki/mw/tests/phpunit/phpunit.php(163): require(string)
#20 {main}

[0] https://travis-ci.org/SemanticMediaWiki/SemanticWatchlist/jobs/178520211

Fatal error: Class 'SWL\HookRegistry' not found

I just updated to 1.0 via composer.phar and now I'm getting:

Fatal error: Class 'SWL\HookRegistry' not found in /var/www/public/wiki/extensions/SemanticWatchlist/SemanticWatchlist.php on line 143

Any pointers?

Got explicit BEGIN from DatabaseBase::begin while atomic section(s) RenameuserSQL::rename are open.

Setup

  • MediaWiki 1.27.0 (758cd9d) 22:24, 28. Jun. 2016
  • Semantic MediaWiki 2.5.0-alpha (570a26b) 12:00, 8. Aug. 2016
  • Semantic Watchlist 1.1.0 (df2732b) 08:18, 7. Jul. 2016
  • Renameuser – (615d761) 20:26, 10. Jun. 2016
  • PHP 5.6.24-0+deb8u1 (apache2handler)
  • MariaDB 10.0.26-MariaDB-1~jessie

Issue

Then trying to rename a user via "Special:Renameuser" I get the following excetion:

[f3fb92ad120ad89873c7fa53] /wiki/Sp%C3%A9cial:Renommer_utilisateur DBUnexpectedError from line 2585 of /.../includes/db/Database.php: Got explicit BEGIN from DatabaseBase::begin while atomic section(s) RenameuserSQL::rename are open.

Backtrace

#0 /.../extensions/SemanticWatchlist/src/TableUpdater.php(40): DatabaseBase->begin()
#1 /.../extensions/SemanticWatchlist/src/MediaWiki/Hooks/UserSaveOptions.php(75): SWL\TableUpdater->updateGroupIdsForUser(integer, array)
#2 /.../extensions/SemanticWatchlist/src/MediaWiki/Hooks/UserSaveOptions.php(68): SWL\MediaWiki\Hooks\UserSaveOptions->performUpdate(array)
#3 /.../extensions/SemanticWatchlist/src/HookRegistry.php(75): SWL\MediaWiki\Hooks\UserSaveOptions->execute()
#4 [internal function]: SWL\HookRegistry->SWL\{closure}(User, array)
#5 /.../includes/Hooks.php(195): call_user_func_array(Closure, array)
#6 /.../includes/user/User.php(5098): Hooks::run(string, array)
#7 /.../includes/user/User.php(3802): User->saveOptions()
#8 /.../includes/session/SessionManager.php(306): User->saveSettings()
#9 /.../extensions/Renameuser/RenameuserSQL.php(199): MediaWiki\Session\SessionManager->invalidateSessionsForUser(User)
#10 /.../extensions/Renameuser/specials/SpecialRenameuser.php(306): RenameuserSQL->rename()
#11 /.../includes/specialpage/SpecialPage.php(479): SpecialRenameuser->execute(NULL)
#12 /.../includes/specialpage/SpecialPageFactory.php(576): SpecialPage->run(NULL)
#13 /.../includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)
#14 /.../includes/MediaWiki.php(745): MediaWiki->performRequest()
#15 /.../includes/MediaWiki.php(519): MediaWiki->main()
#16 /.../index.php(43): MediaWiki->run()
#17 {main}

MW 1.34+ Use of undefined constant DB_SLAVE - assumed 'DB_SLAVE'

Setup and configuration

  • MediaWiki | 1.34.0-rc.0 (366bf66)22:03, 15 October 2019
  • PHP | 7.2.19-0ubuntu0.18.04.2 (apache2handler)
  • MariaDB | 10.1.41-MariaDB-0ubuntu0.18.04.1
  • Semantic MediaWiki | 3.2.0-alpha (c0b7a8f) 17:35, 14 October 2019
  • Semantic Watchlist 8bac58a (master)

Issue

When trying to run "rebuildElasticIndex.php" I get the following error:

PHP Warning:  Use of undefined constant DB_SLAVE - assumed 'DB_SLAVE' (this will throw an Error in a future version of PHP) in /../w/extensions/SemanticWatchlist/includes/SWL_Groups.php on line 34

Warning: Use of undefined constant DB_SLAVE - assumed 'DB_SLAVE' (this will throw an Error in a future version of PHP) in /../w/extensions/SemanticWatchlist/includes/SWL_Groups.php on line 34
UnexpectedValueException from line 462 of /../w/includes/libs/rdbms/loadbalancer/LoadBalancer.php: Invalid server index index #DB_SLAVE

Probably this is killing Elasticsearch replication for the whole wiki.

Backtrace

#0 /../w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(896): Wikimedia\Rdbms\LoadBalancer->getConnectionIndex('DB_SLAVE', Array, 'DB9907120150926...')
#1 /../w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1043): Wikimedia\Rdbms\LoadBalancer->getConnection('DB_SLAVE', Array, 'DB9907120150926...', 0)
#2 /../w/includes/GlobalFunctions.php(2576): Wikimedia\Rdbms\LoadBalancer->getMaintenanceConnectionRef('DB_SLAVE', Array, 'DB9907120150926...')
#3 /../w/extensions/SemanticWatchlist/includes/SWL_Groups.php(34): wfGetDB('DB_SLAVE')
#4 /../w/extensions/SemanticWatchlist/includes/SWL_Groups.php(66): SWLGroups::getAll()
#5 /../w/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php(32): SWLGroups::getMatchingWatchGroups(Object(Title))
#6 /../w/includes/Hooks.php(174): SWLHooks::onDataUpdate(Object(SMW\SQLStore\SQLStore), Object(SMW\SQLStore\EntityStore\StubSemanticData))
#7 /../w/includes/Hooks.php(202): Hooks::callHook('SMWStore::updat...', Array, Array, NULL)
#8 /../w/extensions/SemanticMediaWiki/src/Store.php(234): Hooks::run('SMWStore::updat...', Array)
#9 /../w/extensions/SemanticMediaWiki/src/Elastic/Indexer/FileIndexer.php(409): SMW\Store->updateData(Object(SMW\SQLStore\EntityStore\StubSemanticData))
#10 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Deferred/CallableUpdate.php(349): SMW\Elastic\Indexer\FileIndexer->SMW\Elastic\Indexer\{closure}()
#11 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Deferred/CallableUpdate.php(247): SMW\MediaWiki\Deferred\CallableUpdate->runUpdate()
#12 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Deferred/TransactionalCallableUpdate.php(168): SMW\MediaWiki\Deferred\CallableUpdate->doUpdate()
#13 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Deferred/CallableUpdate.php(285): SMW\MediaWiki\Deferred\TransactionalCallableUpdate->doUpdate()
#14 /../w/extensions/SemanticMediaWiki/src/Elastic/Indexer/FileIndexer.php(418): SMW\MediaWiki\Deferred\CallableUpdate->pushUpdate()
#15 /../w/extensions/SemanticMediaWiki/src/Elastic/Indexer/FileIndexer.php(305): SMW\Elastic\Indexer\FileIndexer->addAnnotation(Object(SMW\SQLStore\SQLStore), Object(SMW\DIWikiPage))
#16 /../w/extensions/SemanticMediaWiki/src/Elastic/Indexer/Rebuilder.php(292): SMW\Elastic\Indexer\FileIndexer->index(Object(SMW\DIWikiPage), Object(ForeignAPIFile))
#17 /../w/extensions/SemanticMediaWiki/maintenance/rebuildElasticIndex.php(378): SMW\Elastic\Indexer\Rebuilder->rebuild('755', Object(SMW\SQLStore\EntityStore\StubSemanticData))
#18 /../w/extensions/SemanticMediaWiki/maintenance/rebuildElasticIndex.php(335): SMW\Maintenance\RebuildElasticIndex->rebuild_row('755', Object(stdClass), '183447', false)
#19 /../w/extensions/SemanticMediaWiki/maintenance/rebuildElasticIndex.php(163): SMW\Maintenance\RebuildElasticIndex->rebuild()
#20 /../w/maintenance/doMaintenance.php(99): SMW\Maintenance\RebuildElasticIndex->execute()
#21 /../w/extensions/SemanticMediaWiki/maintenance/rebuildElasticIndex.php(437): require_once('/var/www/html/s...')
#22 {main}

SWLHooks::addToAdminLinks() is called twice

...once in SemanticWatchlist.php and once in /src/Setup.php. I don't know which place is better for the call, but it shouldn't get called twice, because right now the SWL link shows up twice in Special:AdminLinks.

Special:SpecialPages broken

Trying to view Special:SpecialPages as a logged-in sysop I receive the following message:

Fatal error: Call to a member function text() on a non-object in /var/www/html/w/extensions/SemanticWatchlist/specials/SpecialSemanticWatchlist.php on line 40

Line 40 reads:

public function getDescription() {
    return wfMessage( 'special-' . strtolower( $this->getName() )->text() );
}

When visiting Special:SpecialPages as an unauthenticated user I do not receive this message (Most likely as the SemanticWatchlist pages are sysop only.

Commenting out the lines suggested in the discussion below seems to get around this issue, but I am not sure how that impacts functionality.

http://www.mediawiki.org/wiki/Thread:Extension_talk:Semantic_Watchlist/Error_in_SpecialWatchlistConditions.php_and_SpecialSemanticWatchlist.php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.