# Wiki Bug Fix

**URL:** <https://forum.vassalengine.org/t/wiki-bug-fix/4650>\
**Category:** Module Discussion\
**Created:** [February 2, 2012, 3:10am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650 "2012-02-02T03:10:07Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 3:10am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/1 "2012-02-02T03:10:07Z")

</div>

Somebody needs to fix the [vassalengine.org/wiki/Template:ModuleFile](http://www.vassalengine.org/wiki/Template:ModuleFile). No matter what you enter for the “size” field, it always shows “0”. I can’t believe someone hasn’t at least tried to fix this before.

Here is the current code:

`|-
| [[media:{{{filename}}}|{{{filename}}}]]
| {{{description|}}}
| class="module_file_size" | {{PAGESIZE:{{{filename}}}}}
| class="module_file_date" | {{{date|}}}
| class="module_file_compat" | {{{compatibility|unknown}}}
`

I don’t know much about wiki template coding, so I didn’t want to make a change that would mess everything up, but here is my suggested code:

`|-
| [[media:{{{filename}}}|{{{filename}}}]]
| {{{description|}}}
| class="module_file_size" | {{{filename|}}}
| class="module_file_date" | {{{date|}}}
| class="module_file_compat" | {{{compatibility|unknown}}}
`

Is there a way to test this and see if it would work? It can’t get any worse than it is now. If this won’t work, please leave some suggestions. This seems like it should work, since it would act the same way as the date entry. In my opinion, the code that is causing this problem is: `
{{PAGESIZE:{{{filename}}}}}
`

BTW, if it’s just my computer, please let me know. 😛

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 2, 2012, 3:31am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/2 "2012-02-02T03:31:17Z")

</div>

Thus spake IanSan5653:

> Somebody needs to fix the  
> [vassalengine.org/wiki/Template:ModuleFile](http://www.vassalengine.org/wiki/Template:ModuleFile)[1]. No matter what  
> you enter for the “size” field, it always shows “0”. I can’t believe  
> someone hasn’t at least tried to fix this before.

This is Bug 2928:

[vassalengine.org/tracker/sho … gi?id=2928](http://www.vassalengine.org/tracker/show_bug.cgi?id=2928)

I think what your change will do is print the filename again in the  
size column if no size is explicitly given. This is wrong, because  
you’re not supposed to enter anything for the size field—it’s intended  
to be filled in automatically from the actual size of the file.

If you see a way to do this, we’d happily fix it.

–  
J.

---

<div class="post-metadata">

**Author:** ![irishwulf](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/i/4bbf92/32.png) [@irishwulf](https://forum.vassalengine.org/u/irishwulf)\
**Post date:** [February 2, 2012, 8:57am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/3 "2012-02-02T08:57:23Z")

</div>

I know nothing about Mediawiki, so I apologize if this is naive, but it looked promising at a very casual glance:  
[mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 2:06pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/4 "2012-02-02T14:06:44Z")

</div>

> [@uckelman](#):
>
> Thus spake IanSan5653:
> 
> > Somebody needs to fix the  
> > [vassalengine.org/wiki/Template:ModuleFile](http://www.vassalengine.org/wiki/Template:ModuleFile)[1]. No matter what  
> > you enter for the “size” field, it always shows “0”. I can’t believe  
> > someone hasn’t at least tried to fix this before.
> 
> This is Bug 2928:
> 
> [vassalengine.org/tracker/sho … gi?id=2928](http://www.vassalengine.org/tracker/show_bug.cgi?id=2928)
> 
> I think what your change will do is print the filename again in the  
> size column if no size is explicitly given. This is wrong, because  
> you’re not supposed to enter anything for the size field—it’s intended  
> to be filled in automatically from the actual size of the file.
> 
> If you see a way to do this, we’d happily fix it.
> 
> –  
> J.

So if it’s supposed to be automatic, then why is there a place to enter the size in the template available at [vassalengine.org/wiki/How\_to … odule\_Page](http://www.vassalengine.org/wiki/How_to_Create_a_Module_Page)?

Here is that code:

```auto
== Files ==
{{ModuleFilesTable}}
{{ModuleVersion|version=}}
{{ModuleFile|filename=|description=|date=|size=|compatibility=}}
|}
```

I mean, obviously the automatic part isn’t working, so let’s make it manual.

The code I gave above uses the same format as the date function. If I don’t enter a date, then it doesn’t show the filename again. Why would it with this? I’m not very advanced with wiki coding, but the general idea is similar to other codes. Please explain to me why this wouldn’t work, that might help.

Also, is there anything you do with [mediawiki.org/wiki/Extension:MediaFunctions](https://www.mediawiki.org/wiki/Extension:MediaFunctions)? It does look promising, but I have no idea.

In the meantime, I will copy the code and make a test template/page.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 2:37pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/5 "2012-02-02T14:37:30Z")

</div>

NOTE: There was a mistake in my code, I had meant to say size|, not filename|. Sorry about that. Please sisregard what I had said about that in my last post.

Here is the code I meant to do:

`|-
| [[media:{{{filename}}}|{{{filename}}}]]
| {{{description|}}}
| class="module_file_size" | {{{size|}}}
| class="module_file_date" | {{{date|}}}
| class="module_file_compat" | {{{compatibility|unknown}}}
`

I created a test page here: [vassalengine.org/wiki/Test:M … le\_Bug\_Fix](http://www.vassalengine.org/wiki/Test:Module_File_Table_Bug_Fix)

And a test template here: [vassalengine.org/wiki/Templa … ModuleFile](http://www.vassalengine.org/wiki/Template:BugFixModuleFile)

The template is already implemented on the page; I will tell you if I come up with a solution.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 2:44pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/6 "2012-02-02T14:44:17Z")

</div>

Alright, so I used the code above, and it worked. As long as you don’t mind manually entering the file size, this should work fine. Please see the test page.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 3:59pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/7 "2012-02-02T15:59:26Z")

</div>

Do you think I should change the template? I don’t want to if that isn’t correct.

---

<div class="post-metadata">

**Author:** ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)\
**Post date:** [February 2, 2012, 4:16pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/8 "2012-02-02T16:16:16Z")

</div>

No - please don’t. I would rather have this fixed with a script or the plug in  
that has been brought up and implement that instead

* * *

From: IanSan5653 [iansan5653+vassal@gmail.com](mailto:iansan5653+vassal@gmail.com)  
To: [messages@vassalengine.org](mailto:messages@vassalengine.org)  
Sent: Thu, February 2, 2012 9:59:26 AM  
Subject: [messages] [Module General Discussion] Re: Wiki Bug Fix

Do you think I should change the template? I don’t want to if that isn’t  
correct.

* * *

Read this topic online here:  
[https://forum.vassalengine.org/t/wiki-bug-fix/4650/7](https://forum.vassalengine.org/t/wiki-bug-fix/4650/7)

---

<div class="post-metadata">

**Author:** ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)\
**Post date:** [February 2, 2012, 4:41pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/9 "2012-02-02T16:41:41Z")

</div>

> [@irishwulf](#):
>
> I know nothing about Mediawiki, so I apologize if this is naive, but it looked promising at a very casual glance:  
> [mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)

This should work perfectly - we can alter the template and set the module file size class to look at the media filename in its row

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 2, 2012, 4:47pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/10 "2012-02-02T16:47:24Z")

</div>

Thus spake irishwulf:

> I know nothing about Mediawiki, so I apologize if this is naive, but it  
> looked promising at a very casual glance:  
> [mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)[1]

I didn’t know that existed. It looks like what we need. Thanks!

–  
J.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 8:12pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/11 "2012-02-02T20:12:07Z")

</div>

> [@uckelman](#):
>
> Thus spake irishwulf:
> 
> > I know nothing about Mediawiki, so I apologize if this is naive, but it  
> > looked promising at a very casual glance:  
> > [mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)[1]
> 
> I didn’t know that existed. It looks like what we need. Thanks!
> 
> –  
> J.

Did you take a look at the test pages I made? By all means, try and implement those codes. I’d love to see it work. 😃

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 2, 2012, 8:20pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/12 "2012-02-02T20:20:13Z")

</div>

Again, not very advanced, but isn’t this the basic code that we would need? It will show the file size if entered (before the |) and calculate it if it wasn’t (after the |).

We would still need to get that plugin.

```auto
|-
| [[media:{{{filename}}}|{{{filename}}}]]
| {{{description|}}}
| class="module_file_size" | {{{size|{{#mediasize:Image:filename}}}}}
| class="module_file_date" | {{{date|}}}
| class="module_file_compat" | {{{compatibility|unknown}}}
```

I have no idea if it really would do that, but it seems like it would since it follows the same syntax as the compatibility entry. I’m sure that the size code I entered is wrong, though, because the file isn’t an image. I have no idea how that works. Please correct my coding.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 3, 2012, 4:47am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/13 "2012-02-03T04:47:25Z")

</div>

Thus spake IanSan5653:

> Did you take a look at the test pages I made? By all means, try and  
> implement those codes. I’d love to see it work. 😃

I’ll see about installing the MediaFunctions extension tomorrow. It’s  
too late for me to start doing any sysadminning tonight.

–  
J.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 3, 2012, 10:42pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/14 "2012-02-03T22:42:52Z")

</div>

> [@uckelman](#):
>
> Thus spake IanSan5653:
> 
> > Did you take a look at the test pages I made? By all means, try and  
> > implement those codes. I’d love to see it work. 😃
> 
> I’ll see about installing the MediaFunctions extension tomorrow. It’s  
> too late for me to start doing any sysadminning tonight.
> 
> –  
> J.

Cool, that sounds great. Please let me know how it goes. 😃

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 4, 2012, 5:30am UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/15 "2012-02-04T05:30:45Z")

</div>

Thus spake irishwulf:

> I know nothing about Mediawiki, so I apologize if this is naive, but it  
> looked promising at a very casual glance:  
> [mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)[1]
> 
> [1] [mediawiki.org/wiki/Extension:MediaFunctions](http://www.mediawiki.org/wiki/Extension:MediaFunctions)

It’s installed, and appears to be working.

–  
J.

---

<div class="post-metadata">

**Author:** ![IanSan5653](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/iansan5653/32/129_2.png) [@IanSan5653](https://forum.vassalengine.org/u/IanSan5653)\
**Post date:** [February 7, 2012, 8:29pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/16 "2012-02-07T20:29:14Z")

</div>

Yes, it’s working great! Sorry it took me so long to reply, I didn’t see your post.

---

<div class="post-metadata">

**Author:** ![zmpouf](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/z/73ab20/32.png) [@zmpouf](https://forum.vassalengine.org/u/zmpouf)\
**Post date:** [February 15, 2012, 1:25pm UTC](https://forum.vassalengine.org/t/wiki-bug-fix/4650/17 "2012-02-15T13:25:42Z")

</div>

I just saw that this worked. Great job! 😃
