• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Default radio button unchecked when choosing categories, confusing UI.

adwolf1

Active member
#1
I've found a bit of a UI issue with xfmg -- i'm not sure how to fix it.

1) we've disabled albums for our users via permissions.
2) when they get to the "add media" screen, they are faced with the 'choose a category' dropdown box.

Unfortunately, the radio button is UNCHECKED by default, so they have to press that BEFORE they can even see a category -- this makes no sense. 'Albums' are hidden, so there is only one radio button -- it should be checked by default, but it isn't.

Unfortunately, if you try to check the radio button by default (ie, by editing the template so checked="checked", then when you select a category from the drop-down, the "upload an image" box no longer appears -- it looks like it is triggered by some javascript that doesn't get called when you manually edit the templates to make the categories radio button the default.

What is the proper way to fix this UI issue? I'm surprised that no one has run into it before, i can't be the only person who disables albums!
 

Chris D

XenForo developer
Staff member
#4
It varies but you shouldn't be waiting too long. If I get a chance I'll let you know before the release what the fix is so you may be able to fix it yourself before the release.
 

adwolf1

Active member
#5
It varies but you shouldn't be waiting too long. If I get a chance I'll let you know before the release what the fix is so you may be able to fix it yourself before the release.
Thanks Chris, i'm continuing to modify the templates on my site, but I know I can't roll out this feature until that bug is squashed, or else i'll get an earful :)

thanks again
 

Chris D

XenForo developer
Staff member
#6
This is fixed now, thank you.

There is more to this fix than I'll mention here, but this should work for your specific situation.

To fix this, find the template xengallery_media_add

Find this line:
Code:
<label for="ctrl_site_category"><input type="radio" name="type" class="Disabler ChooseCategory" id="ctrl_site_category" value="category" {xen:checked {$categoryId}} /> {xen:phrase xengallery_a_site_category}:</label>
And replace it with:
Code:
<label for="ctrl_site_category"><input type="radio" name="type" class="Disabler ChooseCategory" id="ctrl_site_category" value="category" {xen:checked '{$categoryId} OR !{$canAddMediaToAlbum} OR (!{$album} AND !{$albumId})'} /> {xen:phrase xengallery_a_site_category}:</label>
 

adwolf1

Active member
#7
This is fixed now, thank you.

There is more to this fix than I'll mention here, but this should work for your specific situation.

To fix this, find the template xengallery_media_add

Find this line:
Code:
<label for="ctrl_site_category"><input type="radio" name="type" class="Disabler ChooseCategory" id="ctrl_site_category" value="category" {xen:checked {$categoryId}} /> {xen:phrase xengallery_a_site_category}:</label>
And replace it with:
Code:
<label for="ctrl_site_category"><input type="radio" name="type" class="Disabler ChooseCategory" id="ctrl_site_category" value="category" {xen:checked '{$categoryId} OR !{$canAddMediaToAlbum} OR (!{$album} AND !{$albumId})'} /> {xen:phrase xengallery_a_site_category}:</label>
hi chris, thanks for the response. unfortunately, the fix doesn't work for me.

while it does select the radio button by default, when you pick a category, the drop-down menu with the upload a file box does not appear below -- the JS isn't being called for some reason.

it is broken across browsers, i tested it in chrome, safari, and firefox.

any ideas?
 

Chris D

XenForo developer
Staff member
#8
There were some additional changes. In which case you will need to undo that change and wait until the full release most likely.
 

adwolf1

Active member
#9
There were some additional changes. In which case you will need to undo that change and wait until the full release most likely.
ok, i can revert to the original, no problem. Any idea when the next version is due to release? (does xfmg get released outside of regular xf releases? or do they usually come together?)