node_preview return access denied page
I am working on quiz questions import module. This module allows quiz authors to create bulk of questions from csv text files. I have no problem in creating questions node from imported file and saving it to database. I would like to show a preview of import question (which are nodes) before they get saved into database. Node object generated from file looks like http://drupalbin.com/10639 . When i call node_view or node_preview with this node object it returns access denied page. Is there anything i need to do before calling node_preview ? Any help will be greatly appreciated. -- Thanks Sivaji
Hi sivaji, Whats your implementation of hook_access? What all permissions you have defined for importing quiz items? Is your complete code available somewhere online? dipen On Fri, Jul 24, 2009 at 1:21 PM, sivaji j.g <sivaji2009@gmail.com> wrote:
I am working on quiz questions import module. This module allows quiz authors to create bulk of questions from csv text files. I have no problem in creating questions node from imported file and saving it to database.
I would like to show a preview of import question (which are nodes) before they get saved into database. Node object generated from file looks like http://drupalbin.com/10639 . When i call node_view or node_preview with this node object it returns access denied page. Is there anything i need to do before calling node_preview ? Any help will be greatly appreciated.
-- Thanks Sivaji
On Fri, Jul 24, 2009 at 1:40 PM, Dipen <dipench@gmail.com> wrote:
Hi sivaji,
Whats your implementation of hook_access?
There is no hook_access. I just tried to write a hook_access which simply return TRUE on all the case, still its not working.
What all permissions you have defined for importing quiz items?
function questions_import_perm() { return array('import_questions'); }
Is your complete code available somewhere online?
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/quiz/includes/q... This code has no questions node preview or node_preview call. It is written very badly, i am trying to refactor and add preview option to it. I just checking whether node_preview trick will work here or not. this is the code which return "access denied page" http://drupalbin.com/10641 around line no 31
-- Thanks Sivaji
participants (2)
-
Dipen -
sivaji j.g