Hi,
When you have a parser function called from within a template, you can of
course pass in to it any template parameters, like:
{{#flagicon:{{{Flag image|}}} }}
(This is a silly example, but bear with me.) I would like to instead be
able to call the parser function without the parameter, like this:
{{#flagicon:}}
...and have the parser function directly get the value of the "Flag image"
parameter.
I believe this can be done within Lua: when a Lua module is invoked from a
template, it can get the names and values of the parameters/arguments that
have been passed to that template using (I believe) code that looks like
the following:
frame = mw.getCurrentFrame()
origArgs = frame:getParent().args
I tried to do something similar within a parser function's code, using
various calls like the following, but nothing worked:
$frame = $parser->getPreProcessor()->newFrame()->newChild();
$args = $frame->getArguments();
Can this be done? Ideally, it would be great to get an array of all the
arguments that have been passed to the template - but just being able to
get the value for a specified parameter name would be good enough.
-Yaron
--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
Hi,
Did I restore my database correctly?
Do I need to delete the database first?
Here's what happened:
I had trouble after upgrade of MW1.31.1 to MW1.35.1. I had had success
with this upgrade on the test version of my wiki, but ran into a
problem with the upgrade of the production version of my wiki. I may
post about that later. Meanwhile, to revert back to the 1.31.1 version
of my production wiki I moved the old files back in place:
-$ mv teflpedia teflpediaNEW; mv teflediaOLD teflpedia
And to revert the database and be rid of whatever changes I had done
when I had run MW1.35.1's maintenance/update.php, I did:
-$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz | mysql -p
bilbo_teflpedia
The database for the wiki is named bilbo_teflpedia, and I had created
that .sql.gz just prior to my upgrade attempt, with this:
-$ mysqldump -p --default-character-set=binary bilbo_teflpedia | gzip
> ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz
Few!
Also, I had set my webhost to PHP 7.3.26 via cPanel, which both
MW1.31.1 and 1.35.1 are compatible with, before the upgade attempt.
Now I'm wondering, did I *combine* the new database with the old one
with that: -$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz |
mysql -p bilbo_teflpedia
Did I properly *replace* the bilbo_teflpedia database with the old one?
Do I need to delete the bilbo_teflpedia database first?
Thanks for any advice!
Roger Chrisman, venomous spider at teflpedia.com one bug at a time
For reference, here's my
* production wiki: https://teflpedia.com/Special:Version
* test wiki: https://tp.rogerchrisman.com/Special:Version