Mod install XML: error="skip" not working.

Started by Antechinus, August 29, 2015, 02:46:31 AM

Previous topic - Next topic

Antechinus

Ok, what's up with this then? Playing around with install XML for a mod. What I want is a way of getting it to skip one specific operation in one file, for a custom template.

I've tried adding the usual error="skip" to the tag for the template, and to the tag for the operation inside the template. This seems to have no effect. The install process doesn't skip at all. It just registers an error for that operation.

If you're wondering what this is all in aid of, I was about to update my infamous memberlist mod with several improvements (extend the concept to the who's online and buddy lists as well, make it responsive, use CSS3 instead of images, add automatic support for RTL languages). So while I was at it, I figured sort it out so Dougiefresh's Quick Buddies mod would work with my mod's custom template.

That requires different code, since adding his mod to the default template means using an anchor inside a table cell, whereas my template requires a bare anchor with no table cells (coz mine be tableless, me hearties). That, in turn and forsooth n stuff, requires his mod to preferably just do a nice little skip when it hits one particular operation.

No can do, apparently. Why not? It seems to me that error="skip" should bloody well do what it says on the tin. :P

Note that at the moment, I'm testing stuff with a custom theme having my custom template, and the default theme still having the default template. When I go to install his mod on the custom theme as well, it just shows the dastardly red error text for that operation.

Any ideas here?

Jade Elizabeth

Hmm can you include a code file that does the job?

I recall something like this but it wasn't error=skip it was something else cause I used to use it on my custom mods (I don't think I uploaded any to here though).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Yeah actually I have thought of a workaround for it, but I'm still curious to know if skip can be made to do the job. That could still be handy for situations where you can't think of a workaround, and it seems weird that I can't get it to skip anyway.

dougiefresh

If you want to skip operations, then you need to use this:
<operation error="ignore">
If you want to skip a particular file because it doesn't exist, you would use something like this:
<file name="$sourcedir/Membergroups.php" error="skip">

Hope this helps!

Antechinus


Jade Elizabeth

I think that's what I was thinking of!

Did that fix it or is it more of a workaround?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Well I figured another any around it anyway, but that one works if you ever need a skip on a specific operation (turns out I don't actually need that any more).

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Ah. Well I figured out that all I had to do was include one short chunk of code in my template by default. It has an !empty set on it so won't throw errors if the mod isn't installed, but the mod will pick it up when it is installed (this is code the mod usually puts into other markup anyway).

Then instead of worrying about skipping the original edit, I just leave that section of the old code commented out. The install xml won't know it's commented, and will just happily edit it regardless. No worries. :)

dougiefresh

Yet another way of dealing with the particular issue is to include your own template file and add/modify the source file to load your template file.  Keep in mind that function names must not already be declared....  If you are replacing template_main, you might name your template function template_main2....

Antechinus

Yeah I know about loading extra files, but it seems like a more boggy solution. In this case I'm just commenting out the original function and replacing it with my own. That's usually bulletproof for install/uninstall, since even if someone has edited the template it won't affect where I'm placing the comment tags.

Advertisement: