CuBoulder / cu_forms_bundle

Easily create contact forms, requests for appointments, questionnaires and surveys.
0 stars 1 forks source link

Move webform related stats into bundle #33

Closed kreynen closed 6 years ago

kreynen commented 6 years ago

In the event that webform nodes exist, but the code has been removed from the site this causes a fatal error.

Similar to how hook_atlas_statistics is called in https://github.com/CuBoulder/express/blob/dev/modules/custom/cu_atlas/cu_atlas.module#L42 return stats specific to Boulder's Express implementation, we want each bundle managing the collection of it's stats.

@alexfinnarn commented on Mon Jul 09 2018

Error: Uncaught exception 'Error' with message 'Call to undefined function webform_get_submission_count()' in /data/atlas/code/profiles/express/express-2.9.1/modules/custom/atlas/atlas_statistics/atlas_statistics.inc:174

in _atlas_statistics_get_webform_statistics called at /data/atlas/code/profiles/express/express-2.9.1/modules/custom/atlas/atlas_statistics/atlas_statistics.inc (93)
in atlas_statistics_atlas_statistics called at /data/atlas/code/cores/drupal/drupal-7.57/includes/module.inc (957)
in module_invoke_all called at /data/atlas/code/profiles/express/express-2.9.1/modules/custom/atlas/atlas_statistics/atlas_statistics.inc (16)
in atlas_statistics_get_statistics called at /data/atlas/code/profiles/express/express-2.9.1/modules/custom/atlas/atlas_statistics/atlas_statistics.module (46)
in atlas_statistics_cron called at /data/atlas/code/profiles/express/express-2.9.1/modules/contrib/elysia_cron/elysia_cron.module (1460)
in elysia_cron_internal_execute_job called at /data/atlas/code/profiles/express/express-2.9.1/modules/contrib/elysia_cron/elysia_cron.module (1424)
in elysia_cron_internal_execute_channel called at /data/atlas/code/profiles/express/express-2.9.1/modules/contrib/elysia_cron/elysia_cron.module (1283)
in elysia_cron_run called at /data/atlas/code/profiles/express/express-2.9.1/modules/contrib/elysia_cron/elysia_cron.drush.inc (161)
in drush_elysia_cron_run_wrapper called at /usr/share/drush/includes/command.inc (422)
in _drush_invoke_hooks called at /usr/share/drush/includes/command.inc (231)
in drush_command called at /usr/share/drush/includes/command.inc (199)
in drush_dispatch called at /usr/share/drush/lib/Drush/Boot/BaseBoot.php (67)
in Drush\Boot\BaseBoot::bootstrap_and_dispatch called at /usr/share/drush/includes/preflight.inc (66)
in drush_main called at /usr/share/drush/drush.php (12)

https://github.com/CuBoulder/express/blob/dev/modules/custom/atlas/atlas_statistics/atlas_statistics.inc#L174

I think some sites must have webforms on them but never had the forms bundle added after it was removed. The entires remain in the database so the foreach loop has webforms to loop through, but none of the code exists.

I think all of the statistics related to bundles should implement hook_atlas_statistics() https://github.com/CuBoulder/express/blob/dev/modules/custom/atlas/atlas_statistics/atlas_statistics.inc#L21 instead of checking for modules or bundles to exist.


@alexfinnarn commented on Mon Jul 09 2018

All for /ethnicstudies https://osr-prod-log01.int.colorado.edu/goto/0a9f1a47ecfe14df365c1af12fbecf21

--

kreynen commented 6 years ago

https://github.com/CuBoulder/express/blob/bf7f46ad2ee1379aa05cfe0bea91e352172035f4/modules/custom/atlas/atlas_statistics/atlas_statistics.inc#L13 is the start of the hook