I'm looking for a part-time remote job.

Hire me

I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).

Follow me:

Handling project identifier change

After changing the identifier Redmine seems to work fine but I can’t tell the same about every third-party Redmine/ChiliProject tool/plugin. When authors were writing such tools/plugins they were believing the identifier can’t be changed... So their tools can be not ready for the change as far as the Project Alias plugin, in fact, breaks Redmine’s internal rules. This page is aimed to help the authors of such third-party tools to support the identifier change.

For third-party plugins using the project identifier the Project Alias plugin provides the :controller_project_aliases_rename_after hook:

        { :project => @alias.project,
          :old_identifier => old_identifier,
          :new_identifier => new_identifier })

The following additional data are passed to the hook in the :context hash:

  • :project - the project the identifier of which has been changed;
  • :old_identifier - the previous identifier which has become an alias;
  • :new_identifier - the new identifier.

To handle the identifier change you need to write:

class YourCustomHook  < Redmine::Hook::ViewListener

    def controller_project_aliases_rename_after(context = {})
        # Old identifier is stored in context[:old_identifier]
        # New identifier is stored in context[:new_identifier]

Terms of use | Privacy policy