Accepted answer

Hi onyx. The handler looks very straighforward and should work with some minimal modifications:

  1. In views_handler_cumulative_field.inc
    replace `drupal_set_message()` with backdrop_set_message() 
  2. In views_cumulative_field.module() be sure to implement hook_autoload_info() so that the class is found, as in 

 

function views_cumulative_field_autoload_info() {
  return array(
    'views_handler_cumulative_field' => 'includes/views_handler_cumulative_field.inc',
  );
}

 

  

That should be it... 

Most helpful answers

To be honest, I don't know if this works in Backdrop - I had copied the info file from D7. In D7, here's the explanation:

https://www.drupal.org/docs/7/creating-custom-modules/writing-module-inf...

@argiepiano - please could you explain what:

dependencies[] = views:views

does as opposed to:

dependencies[] = views

I did the latter in a custom views module and it works. Also, I've not come across that syntax when looking at module development.

And of course you also have to modify the info file as in:

name = Views Cumulative Field
description = Views field that calculates the per-row cumulative value of another field in your view 
backdrop = 1.x
type = module
dependencies[] = views:views

Notice that the "files[]" is not needed, as the handler is loaded by autoload.

Comments

Hi onyx. The handler looks very straighforward and should work with some minimal modifications:

  1. In views_handler_cumulative_field.inc
    replace `drupal_set_message()` with backdrop_set_message() 
  2. In views_cumulative_field.module() be sure to implement hook_autoload_info() so that the class is found, as in 

 

function views_cumulative_field_autoload_info() {
  return array(
    'views_handler_cumulative_field' => 'includes/views_handler_cumulative_field.inc',
  );
}

 

  

That should be it... 

And of course you also have to modify the info file as in:

name = Views Cumulative Field
description = Views field that calculates the per-row cumulative value of another field in your view 
backdrop = 1.x
type = module
dependencies[] = views:views

Notice that the "files[]" is not needed, as the handler is loaded by autoload.

@argiepiano - please could you explain what:

dependencies[] = views:views

does as opposed to:

dependencies[] = views

I did the latter in a custom views module and it works. Also, I've not come across that syntax when looking at module development.

Thanks, man! The autoload_info was the missing magic :-)