I just wanted you to know that I figure it out.
Indeed, my function hook_node_view()
implemented menu_set_active_item("testimonial")
to solve a navigation detail (to force highlighting a menu item...). However, it modified the q
variable in URL and Drupal didn't know anymore that the page was actually a node type testimonial (and thought it was actually a View).
Thereby, my block couldn't appear because it was supposed to show up on node type testimonial (and not on a View).
So, I had to save the true nature of my page in a variable using menu_get_active_trail()
before implementing menu_set_active_item()
.
Eventually, I had to pass this variable in my hook_block_view()
to display the block.
I am sorry for not having given you all the information that was necessary to answer my question. I thought the custom code wasn't very suspect but I was wrong. I'm still a junior Drupal developer and I didn't know what menu_set_active_item()
method did exactly. Thanks however and have a great weekend!