we make a major assumption when setting up the Activity templates that the hook is the exact same as the module. hook_hook_info() allows for clean separation of this (the first key is the module, the next keys are the hooks). I don't have the patience right now to unwind it, but its all in activity.admin.inc
We should be able to module_invoke_all('hook_info') and then find the module that has the hook (array_filter) and then we can use that hook_info in _activity_Settings_form_operations.
Anyways, its kindof a holy mess. That I don't feel like fixing right this minute.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | form_state.txt | 4.35 KB | fizk |
Comments
Comment #1
Scott Reynolds commentedhttp://drupal.org/cvs?commit=313470
Comment #2
jtsnow commentedThis appeared to me to be an issue in other places besides just the admin interface. For example, I've created an og_activity module (I plan to contribute it soon!). I found that some hooks had to be implemented on behalf of the 'og' module rather than my 'og_activity' module.
The hooks that I noticed this for are:
- hook_activity_info
- hook_activity_grants
- hook_activity_access_grants
- hook_activity_type_check
Does this latest commit fix this problem as well or does it only fix the problems on the admin page?
Comment #3
Scott Reynolds commentedthere still might be more gems in there. But we now have a function for it activity_module_name($hook).
So lets find the spots and fix. Create issues for each hook as you see them and we can fix it up.
Comment #4
Scott Reynolds commentedFound a gem! can't reconfigure a template. $hook isn't set.
Comment #5
Scott Reynolds commentedFound it.
http://drupal.org/cvs?commit=318788
Comment #6
fizk commentedStill breaks when modifying an existing template. $hook is NULL for some reason...
I've attached var_dump( $form_state ). Using CVS.
I hope this isn't another epic issue :P
Comment #7
Scott Reynolds commentedOk what are you trying to do thats failing?
How I found the first gem was I tried to edit an existing template and after I clicked save I got the following messages:
* notice: Undefined index: hook in /Users/scott/scott_contrib/activity-DRUPAL-6--2/activity.admin.inc on line 118.
* warning: call_user_func(_activity_info) [function.call-user-func]: First argument is expected to be a valid callback in /Users/scott/scott_contrib/activity-DRUPAL-6--2/activity.admin.inc on line 122.
* notice: Trying to get property of non-object in /Users/scott/scott_contrib/activity-DRUPAL-6--2/activity.admin.inc on line 124.
* warning: Invalid argument supplied for foreach() in /Users/scott/scott_contrib/activity-DRUPAL-6--2/activity.admin.inc on line 124.
And the save doesn't work. With the fix it does work with no messages.
Comment #8
fizk commentedCreating a new template with messages works, but editing an existing template doesn't because $hook is NULL.
Comment #9
fizk commentedDam, I don't have the latest cvs!
Comment #10
Scott Reynolds commentedthen its fixed ;-)
Thats why I try to post a link to the commit. Just click the link and verify the lines match.