humanmade / altis-workflow

Workflow module for Altis
https://www.altis-dxp.com/resources/docs/workflow/
GNU General Public License v3.0
6 stars 3 forks source link

Fatal Error when submitting editorial comment #172

Closed mikelittle closed 2 years ago

mikelittle commented 2 years ago

A fatal error occurs when Steps to reproduce:

  1. I have a Workflow set up as follows: When: "a new editorial comment was added" Subject: "whatever..." Message: "whatever..." Who: "Assignees" Where: "email" (send group: no)
  2. Add an editorial comment to an unpublished post
  3. Assign it to the author and another user (editor)
  4. Press "Comment and Assign"
  5. Though nothing shows on screen(including in QM), the fatal error shown below occurs.
  6. No email is sent
  7. Note: Dashboard notifications do get through.
  8. No notifications appear for the users

Screenshot 2022-07-26 at 16.27.24.png

altis-upgrade-test-php  | [26-Jul-2022 15:26:12 UTC] PHP Fatal error:  Uncaught TypeError: array_reduce(): Argument #1 ($array) must be of type array, int given in /usr/src/app/vendor/humanmade/workflows/inc/class-rest-workflow-comments-controller.php:76
altis-upgrade-test-php  | Stack trace:
altis-upgrade-test-php  | #0 /usr/src/app/vendor/humanmade/workflows/inc/class-rest-workflow-comments-controller.php(76): array_reduce(5, Object(Closure), true)
altis-upgrade-test-php  | #1 /usr/src/app/wordpress/wp-includes/rest-api.php(797): HM\Workflows\REST_Workflow_Comments_Controller->get_items_permissions_check(Object(WP_REST_Request))
altis-upgrade-test-php  | #2 /usr/src/app/wordpress/wp-includes/class-wp-hook.php(307): rest_send_allow_header(Object(WP_REST_Response), Object(WP_REST_Server), Object(WP_REST_Request))
altis-upgrade-test-php  | #3 /usr/src/app/wordpress/wp-includes/plugin.php(189): WP_Hook->apply_filters(Object(WP_REST_Response), Array)
altis-upgrade-test-php  | #4 /usr/src/app/wordpress/wp-includes/rest-api/class-wp-rest-server.php(437): apply_filters('rest_post_dispa...', Object(WP_REST_Response), Object(WP_REST_Server), Object(WP_REST_Request))
altis-upgrade-test-php  | #5 /usr/src/app/wordpress/wp-includes/rest-api.php(386): WP_REST_Server->serve_request('/workflows/v1/c...')
altis-upgrade-test-php  | #6 /usr/src/app/wordpress/wp-includes/class-wp-hook.php(307): rest_api_loaded(Object(WP))
altis-upgrade-test-php  | #7 /usr/src/app/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(false, Array)
altis-upgrade-test-php  | #8 /usr/src/app/wordpress/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
altis-upgrade-test-php  | #9 /usr/src/app/wordpress/wp-includes/class-wp.php(396): do_action_ref_array('parse_request', Array)
altis-upgrade-test-php  | #10 /usr/src/app/wordpress/wp-includes/class-wp.php(758): WP->parse_request('')
altis-upgrade-test-php  | #11 /usr/src/app/wordpress/wp-includes/functions.php(1310): WP->main('')
altis-upgrade-test-php  | #12 /usr/src/app/wordpress/wp-blog-header.php(16): wp()
altis-upgrade-test-php  | #13 /usr/src/app/index.php(21): require('/usr/src/app/wo...')
altis-upgrade-test-php  | #14 {main}
altis-upgrade-test-php  |   thrown in /usr/src/app/vendor/humanmade/workflows/inc/class-rest-workflow-comments-controller.php on line 76

Acceptance criteria:

mikelittle commented 2 years ago

Issue moved to humanmade/Workflows #189 via ZenHub