I was looking trough the views advanced forum creates and came across a broken/missing handler. advanced_forum_active_topics.

Advanced Forum 6.x-2.x-dev (2010-okt-05)
Views 6.x-2.11

Comments

michelle’s picture

Status: Active » Postponed (maintainer needs more info)

Which handler?

Michelle

Michsk’s picture

Sorry tough i pasted that. Error: handler for node_counter > totalcount doesn't exist!

Michsk’s picture

It seem all the advanced forum views are missing that handler.

michelle’s picture

Title: View: advanced_forum_active_topics has a broken/missing handler. » Remove Views column when statistics not enabled
Category: bug » task
Status: Postponed (maintainer needs more info) » Active

Ah, that one. I've "won't fix'd" that in the past because it's not a bug but rather a configuration error. If you don't enable statistics, you need to remove that column. I was going to add that to the docs but I'm going to have a crack at handling it in code. I discovered I can conditionally include the menu option in views and maybe I can conditionally include that column as well. It's a little messy because it will break if you override the view but anyone that overrides the view usually knows what they're doing so it's probably the lesser of two evils.

Michelle

Michsk’s picture

Aha ok, we could also try to get this working with custom fields and a php field, don't know if that would help but it sounds like a option.

michelle’s picture

Nah, not going to re-invent the wheel. Just conditionally add it only when the axle is avalable. :)

Michelle

troky’s picture

What about patch like this in selected views (added at the end of file)? Works for me in D7...

if (!module_exists('statistics')) {
  unset($handler->display->display_options['fields']['totalcount']);
  unset($handler->display->display_options['style_options']['columns']['totalcount']);
}

... but still, I'd like to have statistics built-in AF as Michelle said in #1038430: Adding Statistics module as a dependency to .info

michelle’s picture

Adding them and then unsetting them doesn't make much sense to me. I would just put the module_exists test around the code that adds them to begin with.

Michelle

michelle’s picture

On second thought, your method does make more sense now that I look at it since the code in question is buried in the middle of a huge array so we can't put an if test just around that bit. Working on that now but I'm at camera club and I have some other uncommitted changes so might not get committed tonight.

Michelle

michelle’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Committed to 6.x. Moving this to 7.x. Sorry the commit is too messy to make a patch out of. I had some other stuff in progress that ended up going along with it and I'm gonna try and get it sorted before the next dev snapshot. In the future I'll try to make clearer commits so you can more easily port things to 7.x. Not used to having a co-maintainer. :)

Michelle

troky’s picture

Don't worry Michelle, I'll find the way :)

troky’s picture

Status: Active » Fixed

Ported and committed.

michelle’s picture

Thanks!

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

PILIMILI’s picture

At this moment installing amazon setting the field in views y get this error
Notice: Undefined variable: type in views_get_handler() (line 872 of C:\wamp\www\drupal-7.x-dev\sites\all\modules\views\views.module).
Notice: Undefined variable: type in views_get_handler() (line 872 of C:\wamp\www\drupal-7.x-dev\sites\all\modules\views\views.module).
the path above would work ?
I am new with drupal , i may need further explanation how to work a patch