Closed (fixed)
Project:
Organic Groups
Version:
master
Component:
og.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2008 at 14:42 UTC
Updated:
14 Jul 2012 at 19:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
blackdog commentedStill needs work...
Comment #2
blackdog commentedUpdated patch with working handlers.
I've changed some class names so the og_views handlers have their own namespace.
Comment #3
karens commentedI tried this out and it is pretty close but there are still some problems. I can get to the Views list and the og views show up on the list and can be edited.
1) in the file og_views.views.inc $date['og_uid']['is_manager'] should be using the new name for the handler, 'og_views_handler_is_manager' or you get a 'broken handler' message.
2) When I try to view the og directory, I get a message 'Class 'views_handler_field_numeric' not found in ...og_views_handler_field_og_post_count.inc on line 5.
That second message indicates that the parent handler isn't getting included correctly. The code looks like it is set up right so I don't know why that is broken. The parent is correctly declared in the views_handlers hook, so it should be working.
3) Nothing seems to be actually generating queries. That could be because the handlers aren't getting found, so fixing #2 may take care of that.
I don't have any more time to spend on this right now, but thought I'd add those observations.
Comment #4
yched commentedThis probably misses
(if that's where the new handler files are added)
Comment #5
yched commentedEr, scratch that, that would be if the hook_views_plugins() etc implementations lived in a separate file.
Comment #6
karens commentedNope, you're right. The files *are* in an 'includes' subfolder. That's what's missing. I added that and my problems went away.
I'll add that and my other fix in and roll a new patch.
Comment #7
karens commentedI can't get a patch to include all the new files as the original did, so maybe backdog can re-roll his patch.
Add the change in #4 and rename the handler for $date['og_uid']['is_manager'] to use the new name and things should be working.
Comment #8
rapsli commentedhow can I help with the module?
Comment #9
blackdog commentedRe-roll on the way!
Comment #10
karens commentedOne more change is needed. If you change the path in hook_api(), which you must, you also have to move og_views_views.inc into the includes folder along with all the other .inc files or you'll get messages about missing handlers.
With that last change everything works.
Comment #11
blackdog commentedI've updated the patch with the correct handler name for $data['og_uid']['is_manager'].
There's actually no need for the
'path' => drupal_get_path('module', 'og_views') . '/includes',in hook_view_api(), because the two .inc files that function calls are in the same directory (og_views.views.inc and og_views.views_default.inc).Not working:
* Group directory - something is off with that handler.
* Group search (og/search) - filter handler not working.
All other OG Views seems to be working correctly.
Comment #12
karens commentedAgh!! I take it back, if you move that file the broken handler messages go away, but the views quit working.
I don't have any more time to mess with this now, but it's a path issue, one way or another. You'll have to play around with placing files in different locations and changing the way you declare the paths, then test which combination produces no 'broken handler' messages and creates the right queries.
[Edit] We cross-posted. If you got that much working you got further than I did.
Comment #13
blackdog commentedOk, fixed the fatal error, but can't really say if it's a hack or if something is wrong with either Views class loading or og_views implementation. I removed the _numeric part of the class name in og_views_handler_field_og_post_count.inc, and now the View seems to work.
Og search was 'broken' because I hadn't enabled the search module. This view should probably be disabled as default, or a check be made if search module is available. That's another patch though.
A few other fixes has made it in this patch:
* A string fix in og_views.module for when the default og_ghp_ron view wasn't found:
drupal_set_message(t('The View @name was not found. Check your variables table or settings.php', array('@name' => $name)), 'error');* the database error explained here
* various code style fixes and comments.
Please review.
Comment #14
moshe weitzman commentedThanks for your work, all. I'm hoping someone will review this until is RTBC. I will be sure to commit quickly at that point.
About the search and file library Views depending on other modules - see http://drupal.org/node/279257. I am waiting on Views2 to fix it like Views1 did.
Comment #15
karens commentedRemoving the _numeric part of the class name is *not* the right fix. That means you're extending the wrong class. It fixes the error because the class you really need is not available, so if you put the right class back, you're back to the original error I was finding.
Yes, I also noticed a few views that generated errors because modules were not enabled. The file view won't work if upload module is disabled. So there are a few places that need to do some module_exists() checks before enabling those default views.
Comment #16
karens commentedFound it!!
It's a typo, in hook_views_handlers() we have:
but it *should* be:
Fix that and fix the class name that you altered to avoid the fatal error and it might be working right :)
Comment #17
blackdog commentedUpdated patch fixes #16, and one more typo I made in hook_views_handlers().
All default Views seem to work as expected.
There's a string error on og/my, probably because I haven't enabled PHP filter, but that probably should be handled in another patch.
Comment #18
karens commentedThis gets rid of all the missing file and broken handler messages and I can go into Views and edit and preview my views with no problem. I would say this is ready to commit.
Comment #19
abamarus commentedLooks like you guys are all making good progress on this - and thanks for all your efforts.
I'm having trouble applying the patch though. It looks like the #17 patch requires the module to already be patched with previous patches...? Is this correct? If so what patches do I need to apply and in what order?
Better yet... anyone got a patch that will update from the module as downloaded all in one go?
Thanks again
P
Comment #20
karens commentedNo, the patch works fine applied against the current HEAD of og. If you're having trouble, just sit tight because I suspect moshe will quickly apply this patch and then you'll just have to get the latest HEAD.
Comment #21
moshe weitzman commentedSeems to be working well. I have one minor gripe - too much 'og' prefixing. I took a look at how Views handles its comment handlers/fields at views/modules/comment and its filenames are not prefixed by comment_. The names are just views_handler_field_comment_depth.inc, for example. So, ideally I'd like to see
If noone gets around to this task, I will probably just commit whats here.
I fear that i have too much OG prefixing in the UI as well for field names and filter names and so on. Thats for a different patch.
Comment #22
yched commentedmoshe : see #298823: Views integration using Views' namespace in CCK issue queue
As a result, CCK does now prefix all its handlers with content_...
Comment #23
moshe weitzman commentedVery well then. Committed. Thanks all.
Comment #24
blackdog commentedI added the prefixes to make it easier to see what og_views handles and what views handles, and later I saw the CCK issue yched mentions which makes it clear that og_views should use it's own namespace for it's own handlers.
Comment #25
blackdog commentedSorry, cross-posted...
Comment #26
abamarus commentedSorry to be thick but how do I get the fixed version? The downloads on the module page are still "old" version!
Comment #27
moshe weitzman commentedYou wait up to 12 hours. Thats how often packaging happens for dev snapshots
Comment #28
abamarus commentedThanks.... off to look up web sites on how to be patient!
Comment #29
rapsli commentedlil error:
/og/my
I get some weird text:
OPML feed containing feeds from all your subscribed groups.', array('!url' => url('og/opml'))); ?>
else, seems to work so far. Great work.
Comment #30
blackdog commented#29: If you read above, this is probably because you haven't enabled the PHP filter. Pleas open a new issue for it.
Comment #31
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.