1. We suggest you do NOT update to Joomla 3.8.10 until we can resolve an issue it causes with caching in Fabrik. If you do install it, you'll need to disable Joomla's "System Cache" in the global System settings.
  2. Apologies for the recent server outage, a planned migration by our host provider to a new location turned into a bit of a nightmare.

Search.png not working on list

Discussion in 'Community' started by andre00silva, May 16, 2018.

  1. andre00silva

    andre00silva Member

    Level: Community
    Hello. Recently I've changed all List icons to their ".png" version.
    The "delete" and "edit" buttons worked and their icon has changed. The "search" icon doesn't change tho! Do you know what may be causing this problem?
    cat.PNG

    PS: Ignore the php button at the right side :p
     
  2. Sophist

    Sophist Well-Known Member

    Level: Community
    Looking into this for you now. But I do note that in the /components/com_fabrik/layouts/listactions directory we have layout php files named fabrik-delete-button.php, fabrik-edit-button.php and fabrik-view-button.php but not fabrik-search-button.php.
     
  3. Sophist

    Sophist Well-Known Member

    Level: Community
    I also note that List/Details/Links has fields for changing the Detail, Edit, Delete and Add icons, but no field to allow you to set the Search icon.

    How have you told it to use png icons for Edit, Delete etc. and how for Search?
     
  4. andre00silva

    andre00silva Member

    Level: Community
    That's weird. I've changed the php button icon to "search.php" and it worked!
     
  5. andre00silva

    andre00silva Member

    Level: Community
    The normal detail button doesn't tho ahaha
     
  6. Sophist

    Sophist Well-Known Member

    Level: Community
    Although it is a magnifying glass I think that the search button is actually the Detail icon. Have you set that?
     
  7. Sophist

    Sophist Well-Known Member

    Level: Community
    I have now checked the code and the Magnifying glass should be the Detail icon, and the Lightening should be the plugin button.
     
  8. andre00silva

    andre00silva Member

    Level: Community
    Yeah. In the Detail Icon I've set "search.png" and the magnifying glass doesn't change
     
  9. troester

    troester Well-Known Member Staff Member

    Level: Standard
    There's no ".png" version.
    Fabrik is using xy.png IF this xy.png does exist.
    search.png doesn't, you have to add it into one of the folders Fabrik/Joomla are looking for image files.

    In case the image doesn't exist Fabrik will use the filename without extension as icon (so with search.png you'll get again icon-search)
     
  10. andre00silva

    andre00silva Member

    Level: Community
    If that doesn't exist then why in my php button, if I change it to "search.png" the icon does change into a different magnifying glass?
     
  11. troester

    troester Well-Known Member Staff Member

    Level: Standard
    You are right.
    search.png is also working in the edit link.
    It seems some "search" is hardcoded in the details link. All other x.png are working there, also if you copy media/com_fabrik/search.png to e.g. search1.png and use this in the details link.
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    I'm unable to duplicate this. If I set my "Detail icon" to search.png, I get the media/com_fabrik/images/search.png image. It does what I'd expect it to:

    In FabrikHelperHTML::Image() ...

    https://github.com/Fabrik/fabrik/blob/master/libraries/fabrik/fabrik/Helpers/Html.php#L2284

    ... it calls getImagePath(), which looks in the predefined folder locations as defined in addPath() ...

    https://github.com/Fabrik/fabrik/blob/master/libraries/fabrik/fabrik/Helpers/Html.php#L2212

    ... it finds the image.png in our media folder, so $src is not empty and $forceImage gets set to true on line 2285, so it skips the icon handling and builds the img tag instead.

    I'm not saying you guys aren't having issues with it, just that I can't replicate it, and I can't immediately think of where the problem might be. The logic is pretty simple. We look through our image folder paths for a file with the specified name, if we find that we use an img tag for that file, if we don't find it we use an icon tag (using the filename part of the image name, with the extension stripped).

    -- hugh
     
    andre00silva likes this.
  13. troester

    troester Well-Known Member Staff Member

    Level: Standard
    Strange
    On my site it really only search.png not working in the details link.
    search.png is working e.g. in the edit link
    all other xy.png are working in the details link, too.

    I'll step through the code if I have time...
    Meanwhile copying search.png to search1.png and putting this in the details link is a workaround.
     
    andre00silva and cheesegrits like this.

Share This Page