Closed (fixed)
Project:
Checklist
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2012 at 09:50 UTC
Updated:
25 Apr 2012 at 21:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
j_ten_man commentedCan you post the module you wrote here just as a zipped up file? I'll take a look over it and let you know.
I'm not completely clear what your question is. You shouldn't have to save the checklist item instance. The API should do that for you. You just define some additional fields as needed for your new item type.
Comment #2
BruFFy commentedI've tried a lot of things to make it work so there might be some strange code in there ^^
I want to check if a user has liked a page on facebook.
There is no data or node that needs to be saved, just the checklist item needs to be 'checked'.
I couldn't find a example to see how things should work with a custom module.
Comment #3
j_ten_man commentedThe function
checklist_pro_checklist_item_user_like_us_display_options($instance, $item, $account)returns the path that the checklist item links to: checklist_pro_like_import. This path however is not in your list of allowed urls returend bychecklist_pro_checklist_item_user_like_us_allowed_paths($instance, $item, $account)(Actually it looks like you haven't set that function up yet). So you need to add that path. When a user clicks the item, it will go to that path and you should then check if they've completed the facebook instance. When you hit that path,checklist_pro_checklist_item_user_like_us_process_item($instance, $item, $account)will be called and that is where you should check if the user has completed the item, and if so you would return TRUE. If they haven't, then you could setup that path using hook_menu() to display a page to say something about liking the required page on Facebook.Hopefully that will get you moving more in the correct direction.
Comment #4
BruFFy commentedOh, I thought _allowed_paths is used when you limit navigation.
Thanks for the help!
Comment #5
j_ten_man commentedIt is used when limiting navigation but it's also used to check if the current path is the one for one of the checklist items. Good luck. Let me know if you have more questions.