http://royal-family.bitplan.com/index.php/Template:Sidebyside does not work any more - results are not displayed
see http://royal-family.bitplan.com/index.php/Main_Page - it should show 15 royal family pictures linked to the corresponding pages but non shows.

I assume the named args behavior has changed and the arg names are not starting with? anymore or something along these lines. For debugging i added
{{{?picture|}}}
<includeonly>
{{{?picture|}}}
⁣[[{{{?picture|}}}|{{{userparam|150}}}px|link={{{?page|}}}]] </includeonly>
@WolfgangFahl try to remove "?" from the parameters in the Template:Sidebyside. See the migration guide from Semantic MediaWiki 2.5.x to Semantic MediaWiki 3.0.x, specially:
template format becomes alias of the plainlist format? as prefix for template argumentsIt seems my assumption was right and http://royal-family.bitplan.com/index.php?title=Template%3ASidebyside&type=revision&diff=1332&oldid=1331 is a workaround. I'd hate to have to change dozens of other templates and wonder what motivated this change and where it (the motivation) is documented.
I'd rather see the change to be optional instead of forcing a migration. Is there some bot script available to help in the migration?
Ping @s7eph4n
You could simply visit http://royal-family.bitplan.com/index.php/Special:ReplaceText and replace {{{? by {{{, probably selecting the Template namespace.
Thanks to @s7eph4n the template/list/plainlist, ol and ul formats were improved a lot in SMW 3.0.0 (a major release with expected changes - almost a year ago).
These changes were documented in SMW 3.0.0 release notes.
@jaideraf thank you for the excellent work-around proposal. My usecase is slightly different since some of my templates are generated. The change of the generator will also be simple. I'd suggest to add a note about this migration tipp to the named args parameter explanation. https://www.semantic-mediawiki.org/wiki/Help:Named_args was just created by me to facilitate this.
By the way - i still consider it a bug that this is not configurable. The reasoning for me is like this:
If we do an impact and cost benefit analyis of the change i think the result will be:
Here is a pywikibot/python based approach of checking the use of named args:
migrate.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import pywikibot # no need to import in user_config.py
from pywikibot import config2 # no need to import in user_config.py
from pywikibot import pagegenerators
import argparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description='migrate the given wiki to SMW 3.0+')
parser.add_argument('--debug',action="store_true",help='show debug info')
parser.add_argument('--wiki', default="smw", help='the name of the wiki')
parser.add_argument('--lang', default="en", help='the language of the wiki')
parser.add_argument('--scriptpath', default="/", help='the scriptpath of the wiki')
# parse the command line arguments
args = parser.parse_args()
family = args.wiki
mylang = args.lang
familyfile=os.path.abspath(os.path.expanduser("~")+'/.pywikibot/families')+"/"+family+"_family.py"
if not os.path.isfile(familyfile):
print ("family file %s for wiki %s is missing" % (familyfile,args.wiki))
else:
print ("will try to use family file %s for wiki %s" % (familyfile,args.wiki))
config2.register_family_file(family, familyfile)
mysite=pywikibot.Site(mylang, family)
print("migrating templates for %s" %(mysite.sitename))
templateNameSpace=10
pages=mysite.allpages(namespace=templateNameSpace)
for page in pages:
# https://doc.wikimedia.org/pywikibot/master/_modules/pywikibot/page.html
title=page.title()
ttext=page.text
soup = BeautifulSoup(page.text,'html.parser')
for codeNode in soup.find_all('includeonly'):
if "{{{?" in codeNode.text:
print ("%s has named args" % (title))
$HOME.pywikibot/families/smw_family.py
# -*- coding: utf-8 -*-
from pywikibot import family
class Family(family.Family):
name = 'smw'
langs = {
'en': 'www.semantic-mediawiki.org',
}
def scriptpath(self, code):
return '/w'
def protocol(self, code):
return 'https'
requirements.txt
# 2019-09-28
Pywikibot
beautifulsoup4
install
#!/bin/bash
# WF 2019-07-27
# install pre requisites
# install python3-yaml
# install required modules
os=$(uname -a)
case $os in
Darwin*)
pip="sudo -H pip"
install="sudo port install"
;;
*)
pip="pip3"
install="sudo apt-get install"
;;
esac
$install python3-pip
$install python3-yaml
$pip install -r requirements.txt
To prepare follow https://www.mediawiki.org/wiki/Manual:Pywikibot and call
./install
then run
python3 migrate.py
and you'll get:
Template:Attendee has named args
Template:Conference presentations has named args
Template:Demo/Template/City/ImageShow has named args
Template:Demo/Template/City/ImageShow has named args
Template:EventBadge has named args
Template:Property has named args
Template:Query named output demo has named args
Template:Show SMW site has named args
Template:SpecialPropertyRow has named args
Template:Topic has named args
Template:Tree format with named args has named args
so even our own environment is broken :-(
ping @kghbln
This is still a show stopper for migration
Most helpful comment
You could simply visit http://royal-family.bitplan.com/index.php/Special:ReplaceText and replace
{{{?by{{{, probably selecting the Template namespace.Thanks to @s7eph4n the
template/list/plainlist,olandulformats were improved a lot in SMW 3.0.0 (a major release with expected changes - almost a year ago).These changes were documented in SMW 3.0.0 release notes.