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:

Two new hooks in Hooks Manager 1.0.1

Hooks Manager 1.0.1 comes with new user profile hooks, that were added in Redmine 2.4.x. Additionally, this release includes some bug fixes...
Added by Andriy Lesyuk over 10 years ago

Download Hooks Manager 1.0.1

Since the release of Hooks Manager 1.0.0 Redmine got two new hooks – view_my_account_right_bottom and view_users_form_right_bottom – both are related to the user profile. One of these hooks adds content below preferences in the user’s own profile (better known as “My account”), another one – below preferences on the user edit page (in Administration → Users). Both these hooks are now supported by Hooks Manager.

The location of one of the hooks

These hooks were suggested for Redmine by Johnny Tide. How do I know this?.. Cause Johnny also suggestes to use them in my Contact Form plugin. Moreover, he did updated the Contact Form plugin and shared the patch (see #2208) with me. It’s astonishing, how such an active contributor to Redmine can also be a contributor to my plugin and suggest changes to Redmine, that get also reflected in my other plugin... By the way, as far as I know, he needed these hooks for some other plugin, he developed or contributed to (check also his Github page).

But these hooks are not the only change in Hooks Manager 1.0.1. Thus, they were added in Redmine 2.4.x and the version 1.0.1 of Hooks Manager will also run under Redmine 1.4.x... So, displaying these two hooks for this older version of Redmine would be, at least, incorrect (as users could get confused, why they did not work). So, exactly for such cases I planned to implement support for the require property of the placeholder (see #2211). And I did it in 1.0.1! This way under Redmine 1.4.x you just won’t see new (not-yet-available) hooks...

But the version 1.0.1 also comes with bug fixes.

The view_layouts_base_html_head hook of Redmine, which is known as the only “HTML header” hook (“All pages”) in the Hooks Manager plugin, can be used for loading some additional CSS styles, JavaScript functions, and so on. At the same time Hooks Manager also used it for adding styles! But, while developing it I forgot that a plugin can add only one handler for the hook. So, custom HTML content, that was specified for this hook in Administration → Hooks, did not work...

This issues was noticed by Fabien Crespel. He also investigated this issues, found the reason, fixed it and shared the patch (see #2295)! So, in version 1.0.1 I applied his patch (with some modifications). In other words, this issue is now resolved! Thanks, Fabien!

Another weird issue was found by Christopher Caruk – due to wrong (my) code and Christopher’s specific environment the plugin loaded jQuery functions, but tried to use prototype (older) ones... Now it loads and uses same functions (which exactly – depends on the actual environment and application versions).

New-hooks.png View - The location of one of the hooks (2.28 KB) Andriy Lesyuk, 16 Jun 2014 20:13


Comments

Terms of use | Privacy policy