Project

General

Profile

Strange Redmine plugin problem. Caching views?

Added by Paweł Jędrzejczyk almost 12 years ago

Hi. I just started learning RoR and Redmine. I am writing plugin that allows to add custom :top_menu items.
I use Redmine 1.4.4 and Apache Passenger. RAILS_ENV is set to production.

Everything works fine, except for displaying the menu items. The problem is that everytime I refresh the page (no matter which one) after adding, deleting or editing menu item the menu does not update. But when I refresh the page again everything is ok (added items appears, deleted items disappears). The strange thing happen when I refresh the page once again - menu items are not updated.

Of course when I restart Redmine by restarting Apache server menu items are updated, because I am getting them from database, and adding to Redmine's :top_menu in init.rb file of my plugin. Every action (add, edit, delete) apart from modifying database I also modify Redmine::MenuManager.map(:top_menu) with push and delete, so displayed menu items should reflect items in database on every page, but it isn't working like that.

My plugin is almost the same as http://www.redmine.org/plugins/redmine_appmenuadds but I use :top_menu instead of :application_menu

Public folder is empty so I guess caching is turned off.

Any ideas?