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

Fixed Notices in Media Gallery

Discussion in 'Media Gallery Resolved Bugs' started by Mr Lucky, Nov 13, 2014.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    The notice system page criteria allows you to specify a template e.g.


    as well as categories

    However if you do that it displays in neither, then throws up an error on the category page:

    An exception occurred: in_array() expects parameter 2 to be array, null given in /public_html/library/XenGallery/Listener.php on line 340

    An exception occurred: in_array() expects parameter 2 to be array, null given in /home/caf/public_html/library/XenGallery/Listener.php on line 340
    in_array() in XenGallery/Listener.php at line 340
    call_user_func_array() in XenForo/CodeEvent.php at line 90
    XenForo_CodeEvent::fire() in XenForo/Helper/Criteria.php at line 538
    XenForo_Helper_Criteria::pageMatchesCriteria() in XenForo/ViewRenderer/HtmlPublic.php at line 228
    XenForo_ViewRenderer_HtmlPublic->_getNoticesContainerParams() in XenForo/ViewRenderer/HtmlPublic.php at line 128
    XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 618
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
    XenForo_FrontController->run() in /public_html/index.php at line 13
    Last edited: Nov 13, 2014
  2. Chris D

    Chris D XenForo Developer Staff Member

    Admittedly, that type of error should never be shown and so I have fixed that for the next release.

    However, this would only happen if you don't select a category:


    You actually need to select the categories you want the notice to show in:


    If you do that, the error will not be shown.

    It's worth noting, though, that when the fix rolls out for this, in your current set up (no categories selected), the notice would be ignored and just not show.
    resonansER likes this.
  3. Mr Lucky

    Mr Lucky Well-Known Member

    It seems to be an issue even with categories selected
    Great! Thanks
  4. Mr Lucky

    Mr Lucky Well-Known Member

    More specifically:

    • If you have just a content template for the notice - it works fine
    • If you select one or more categories but no content template - it works fine (as expected showing on this categories)


    If you have both a content template and one or more categories selected, it shows on neither (and sometimes causes an error but not always it seems)

    So it seems to me you should not be allowed to have both a content template and categories selectable.
  5. Chris D

    Chris D XenForo Developer Staff Member

    That's expected.

    You're telling the notice to show on template xengallery_media_index AND in category X. The template being loaded on category pages would be xengallery_category_view, so it simply isn't possible to match your criteria.

    You can't be in a category and on the media index at the same time.
  6. Mr Lucky

    Mr Lucky Well-Known Member

    That's fair enough, but in that case you shouldn't be allowed to actually do both in the Notices options

    ie with both options there it makes you think it should be possible and so it's rather confusing.
  7. Chris D

    Chris D XenForo Developer Staff Member

    It's just how notices work for everything, and how they have always worked. It just requires a thought process to analyse the criteria you're providing is logical and possible. There's quite a few cases where you can apply a criteria that is impossible to fulfil.
    Brogan likes this.
  8. Mike

    Mike XenForo Developer Staff Member

    It can't know that. The criteria can be combined together, you're just using something that isn't impossible. It's roughly equivalent to setting the criteria to be both a registered user and a guest; here, you're making a situation where it can't be possibly by requiring a template that isn't used in a category and that you're in a particular category.
    resonansER and Chris D like this.
  9. Mr Lucky

    Mr Lucky Well-Known Member

    Yes, I totally understand that now
    but those of us with a bit less brains or different kinds of thought process or knowledge of the intricacies of forum software can be easily confused. I just thought it would be better for non-techies or less logical people to not have the option to do impossible things which actually appear on the face of it to be possible.

    Or you could just have some text saying: "You can't do both"

Share This Page