4

We updated two different Test systems with the CiviCRM Security Release (5.50.0, 5.49.4, 5.45.6 ESR) from 1st of June 2022. One test system has Drupal7 and CiviCRM 5.49.4, the other one has Drupal9 and CiviCRM 5.49.4. (We updated the latter to CiviCRM 5.50.1, but the problem persists.)

After the update, we cannot change Cases via Drupal Webform (which is using the CiviCRM API) anymore if we are logged in as a test user. When we try, the webform returns a success message, but the changes are not saved in CiviCRM and in the error protocoll it says:

The CiviCRM "case create" API returned the error: "Index 0 not found in api results" when called by function "postSave" on line 222 of wf_crm_webform_postprocess.inc with parameters: "Array ( [medium_id] => 1 [case_type_id] => 4 [status_id] => 1 [subject] => testsubject [custom_118] => [custom_283] => 1 [custom_6] => Array ( ) [custom_9] => [custom_120] => [custom_11] => [custom_128] => 0 [custom_12] => [custom_307] => 19940614 [custom_131] => Array ( ) [custom_15] => Array ( ) [custom_300] => [custom_139] => Array ( ) [custom_280] => [custom_18] => Array ( ) [custom_314] => Array ( ) [custom_26] => Array ( ) [custom_51] => Array ( ) [custom_121] => Array ( ) [custom_122] => Array ( ) [custom_294] => [custom_167] => 0 [custom_281] => Array ( ) [custom_295] => [custom_240] => [custom_288] => [custom_241] => [custom_290] => [custom_57] => Array ( ) [custom_249] => [custom_309] => [custom_81] => Array ( ) [custom_256] => [custom_308] => [custom_87] => Array ( ) [custom_270] => [custom_271] => [custom_272] => [custom_274] => Array ( ) [custom_92] => 0 [custom_93] => [custom_94] => [custom_95] => [custom_96] => [custom_97] => [custom_98] => [custom_277] => [client_id] => 2016 [id] => 3845 [check_permissions] => [version] => 3 ) "

We can change Cases via Drupal Webform as admins. Creating/changing Cases via the CiviCRM GUI works (as test user and admin), as well as creating/changing Cases using the CiviCRM API3 Explorer (as admin). As the latter works well, the problem cannot lie in the CiviCRM API itself, but it has to be an issue with the way Drupal webform calls the CiviCRM API. On the other hand, as the problem exists in both Drupal7 and Drupal9, and didn't occur in both of these systems before the CiviCRM Update, it cannot really be a problem in Drupal webform as well.

Did anybody meet a similar problem when updating to this Security Release, and found out why? Does anybody know if this update changed something related to permission model / user roles? Any hint is appreciated.

5
  • The security release does contain a stricter check on permissions in some situations, but it's not immediately obvious why it affects this. And in the log above it says check_permissions is turned off.
    – Demerit
    Commented Jun 14, 2022 at 17:07
  • Hi Emma - I have seen one other report of this. I’ll ask one of my team to look into it. Commented Jun 15, 2022 at 2:24
  • This is also affecting us in 5.49.5 (and Drupal 7). Some non-admin users can update cases with forms but there's no obvious pattern to their permissions, so far. We use ACLs and Drupal roles. Commented Jun 15, 2022 at 7:18
  • Oh that does sound like permissions. Emma -> can you please update your D9/CiviCRM to 5.49.5 (you should that .4 -> .5 will fix some WFC errors as that point release update addressed an API regression in Core). Then try and reproduce the issue with Drupal 9. If you can reproduce it, please share your exact scenario/settings with us by exporting that form's config. We will then write a test that will cover that scenario (we have a test to Create a Case - but no Update one yet). Commented Jun 17, 2022 at 1:24
  • We already added the test (see answer) Commented Jun 18, 2022 at 14:18

2 Answers 2

3

We have confirmed that this is a regression in CiviCRM Core by writing an automated test for WFC module. It clearly shows that the latest public 5.45.* is still green -> after that -> red

I have reported the issue in CiviCRM's product management channel. Hopefully it will be addressed quickly for you. Once it has been fixed we will merge this new UpdateCase test into the WFC module Github repo so it will run on every PR as well as against CiviCRM RC and even dev-master to ensure this exact issue will never resurface.

If you want to help contribute to our work and efforts -> consider making a contribution here -> https://webform-civicrm.io/form/sponsor-webform-civicrm-module

enter image description here

2

Note that the issue has now been reported as a gitlab and that is the place to follow along with it https://lab.civicrm.org/dev/core/-/issues/3671

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.