1. 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.

Discussion in 'Media Gallery Resolved Bugs' started by adwolf1, Jun 6, 2015.

  1. adwolf1

    adwolf1 Active Member

    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!
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    We'll look at this as a bug.
     
  3. adwolf1

    adwolf1 Active Member

    thanks chris --

    i've just started using xfmg, i am unfamiliar with the release cycles, do you typically save up a bunch of small bugs & do major releases, or are bug fix releases more frequent?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
  5. adwolf1

    adwolf1 Active Member

    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
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    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>
    
     
  7. adwolf1

    adwolf1 Active Member

    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?
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    There were some additional changes. In which case you will need to undo that change and wait until the full release most likely.
     
  9. adwolf1

    adwolf1 Active Member

    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?)
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    They are separate releases but may happen at the same time.
     

Share This Page