XF 2.0 Avatar tag error when importing add-on data - Bug or am I missing something ?

XFA

Well-known member
Hi,

I am trying to import development output data from one of my add-on.

However when importing I get the following error :
Importing template modifications...
Importing XFA/XFMGExtension...
1/2 [==============>-------------] 50%

[XF\PrintableException]
Line 207: Tag avatar must have an attribute User. - Template name: public:xfmg_album_view

Anyone ever experienced that ?

Clément
 
What does your xfmg_album_view template modification change? Do you have any other add-ons installed that have tried to change that template?

Either your template modification is trying to do something that isn't valid and thus shouldn't have been saveable via the control panel or a combination of template modifications has made that template invalid.
 
I have two modifications:
Code:
{
    "template": "xfmg_album_view",
    "description": "Add watchers",
    "execution_order": 10,
    "enabled": false,
    "action": "str_replace",
    "find": "<div class=\"columnContainer-sidebar\">\n\t\t\t<xf:macro name=\"info_sidebar\" arg-album=\"{$album}\" />\n\t\t\t<xf:macro name=\"privacy_sidebar\" arg-album=\"{$album}\" arg-addUsers=\"{$addUsers}\" arg-viewUsers=\"{$viewUsers}\" />",
    "replace": "$0\n\t\t\t<xf:macro template=\"xfa_me_xfmg_album_view\" name=\"watchers\" arg-album=\"{$album}\" />"
}
Code:
{
    "template": "xfmg_album_view",
    "description": "Add watchers",
    "execution_order": 10,
    "enabled": true,
    "action": "str_replace",
    "find": "<xf:sidebar key=\"shareSidebar\">\n\t\t<xf:macro name=\"share_sidebar\" arg-album=\"{$album}\" />\n\t</xf:sidebar>",
    "replace": "<xf:sidebar key=\"watchers\">\n\t\t<xf:macro template=\"xfa_me_xfmg_album_view\" name=\"watchers\" arg-album=\"{$album}\" />\n\t</xf:sidebar>\n\t$0"
}

Those modifications were done from the admincp and were saved, hence why it is odd.

I have no other add-on currently installed that touches this template.

Clément
 
I'm not sure I see an obvious reason for it, unless somehow there's a version of the template saved that isn't valid. In the default template, the line in question is:
Code:
<xf:avatar user="$album.User" size="s" defaultname="{$album.username}" />
Which clearly has the necessary attribute.

You may need to check non-default styles to see if one of them is wrong already.
 
No no the template is fine I checked.
But if you look at the error the u of user is in capital.

If I change user to User in the template it works but then if I try to test and save the template in acp it says attribue user (without capital) is missing.
Very odd situation.
 
It's referring to the attribute name user -- that's correct in the line that I showed. It's not related to the value of the attribute.
 
Yes but it states with a U in capital letter as I stated.
Line 207: Tag avatar must have an attribute User. - Template name: public:xfmg_album_view
I was not speaking at all of the value.
 
Oh sorry, misinterpreted. You're right and that is probably the cause of the issue, at least as far I could guess.

The code that triggers that error is pretty clear cut with "user" and there aren't any string manipulations to it, so I really don't know why that would be coming out with a capital letter.
 
Nor do I.

I tried that on a fresh install as well and had the issue.
With only my addons plus RM and MG installed.

Would that be a bug ?
 
Without seeing your template modification, is it possible you've added or modified a macro and used $album.User without it being defined in your macro?

$album.User is a relation to $album, that's why the upper case U.
 
Read carefully the exchanges @Snog, my issue is with the attribute name not the value.
I'll stand by what I said. If you modified that portion of the template and the modification did something funky with that attribute, it might throw the error.

And I was pointing out the reason for the upper case 'U' and that it is correct.
 
Last edited:
You have my template modification here above, I don't touch the part of the template that is erroring.
 
If you can zip up the add-on that you suspect is causing the problem and then send that to me via conversation I’ll happily take a look.
 
Hum in fact it stopped popping the error.
I guess I had messed up my previous setup and the new one is fine.

Sorry for making you loose your time.
 
Back
Top Bottom