SemanticMediaWiki / SemanticCite

Allows to manage citation resources using semantic annotations
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Cite
Other
24 stars 13 forks source link

Call to deprecated wfWikiID() #110

Closed eoplus closed 1 year ago

eoplus commented 1 year ago

The file SemanticCite.php in the root folder has a call to wfWikiID(). In my system (MW 1.38.5) I get a warning when running jobs (maintenence/RunJobs.php) stating that wfWikiID() is deprecated since MW 1.35. The function WikiMap::getCurrentWikiId() should be used instead (https://www.mediawiki.org/wiki/Manual:Wiki_ID)

krabina commented 1 year ago

In MediaWiki 1.39 this results in an error

[6b1ae8edc6b36dc0467ba0df] /Hauptseite Error: Call to undefined function wfWikiID()

Backtrace:

from /home/knowledge/test/extensions/SemanticCite/SemanticCite.php(149)
#0 ../includes/Setup.php(532): SemanticCite::onExtensionFunction()
#1 ../includes/WebStart.php(86): require_once(string)
#2 ../index.php(44): require(string)
#3 {main}
krabina commented 1 year ago

If I change the function call, I get

[8ecdc6b597714240003b5cc2] /Hauptseite InvalidArgumentException: Invalid object cache type "CACHE_ANYTHING" requested. It is not present in $wgObjectCaches.

Backtrace:

from /home/knowledge/test/includes/objectcache/ObjectCache.php(101)
#0 ../includes/objectcache/ObjectCache.php(77): ObjectCache::newFromId(string)
#1 ../extensions/SemanticMediaWiki/src/CacheFactory.php(138): ObjectCache::getInstance(string)
#2 ../extensions/SemanticMediaWiki/src/CacheFactory.php(122): SMW\CacheFactory->newMediaWikiCache(string)
#3 ../extensions/SemanticCite/SemanticCite.php(168): SMW\CacheFactory->newMediaWikiCompositeCache(string)
#4../includes/Setup.php(532): SemanticCite::onExtensionFunction()
#5 ../includes/WebStart.php(86): require_once(string)
#6 ../index.php(44): require(string)
#7 {main}
krabina commented 1 year ago

see https://github.com/SemanticMediaWiki/SemanticCite/pull/105

krabina commented 1 year ago

Should be fixed with #116. If not, feel free to reopen.