Hi,
When not using the provided CSS generation (in this case because I don't want them as background images) menu icons show a bug behaviour handling cache.
In the code it is assumed that the way to refresh the icons after submit is through
image_path_flush (clears the styles)
menu_icons_css_generate (recreates the css)
However the menu's cache is not cleared. Because the way menu icons works is assuming the icon is part of the menu link (e.g like menu attributes) the following function should be called when the icon changes:
menu_cache_clear_all();
This assures the menu information gets refreshed when there is a change.
This is particularly useful to people (like myself) that are implementing theme_menu_link hooks to change the rendering of the menu item (in my case to make the images inline). By clearing the menu's cache we ensure that theme_menu_link can get called again if there is a change in the menu item (e.g menu icon changed).
I will submit a small patch in the following comment.
Comment | File | Size | Author |
---|---|---|---|
#6 | menu_icons_rebuild_css.patch | 1.33 KB | NewZeal |
#2 | menu_icons-issue_2456121-2.patch | 876 bytes | kyuubi |
#1 | menu_icons-clearing_menu_cache-2456121-1.patch | 372 bytes | kyuubi |
Comments
Comment #1
kyuubi CreditAttribution: kyuubi commentedHere is the patch.
Comment #2
kyuubi CreditAttribution: kyuubi commentedUpdating the patch as this needs to happen also in menu_icons_node_save
Comment #3
kyuubi CreditAttribution: kyuubi commentedHi,
Also I would like to volunteer to be a maintainer for this module.
Let me know if you are interested.
Thanks,
Comment #4
jomarocas CreditAttribution: jomarocas as a volunteer commentedthanks for your patch, but the second patch #2 is for a git? no working and is wrong the method
thanks for patch
Comment #5
NewZeal CreditAttribution: NewZeal at Passing Phase Web Development commentedThere is no need to clear the menu cache. Cache clear all works because it rebuilds the menu_icons css which is where all the action is. It would be better if menu_icons had the following in form_alter
With the following function available
As it is, it has been two years since anyone last committed to this module so not much chance of anything happening soon!
Comment #6
NewZeal CreditAttribution: NewZeal at Passing Phase Web Development commentedHere is a patch to accompany my previous comment.