0

I am using Advanced poll module to create polls in Drupal 7.

I want to show poll options and vote button to authenticated users, but I want to show poll options and a message instead of vote button to anonymous users.

I've achieved this by editing the advanced poll module, however I am scared of losing changes on core update.

Is there any hook or method to achieve this without editing core files?

  • 1
    Instead of modifying the module file, have you tried module permissions? – Nikhil Banait Oct 21 '15 at 11:45
  • Yes, I have tried changing permissions too. If I set the poll to be open for authenticate users only, then anonymous users can't be able to see the poll options. If I set the poll to be open for everyone, anonymous users can be able to see the vote button too. I want to show the poll options but not the vote button to anonymous users. – Sai Kiran Sripada Oct 21 '15 at 11:57
  • 1
    OK. Create custom module and override your changes into it. Never modify any contributed or core module. – Nikhil Banait Oct 21 '15 at 12:06
  • Thanks @NikhilBanait I have solved the issue using hook_node_view in my custom module. :) – Sai Kiran Sripada Oct 21 '15 at 12:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.