Answers.Body: <p>This is fixed in <a href="https://github.com/civicrm/civicrm-drupal-8/pull/94" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-drupal-8/pull/94</a>.</p>
  <p>5.74 backport at <a href="https://github.com/civicrm/civicrm-drupal-8/pull/96" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-drupal-8/pull/96</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-03T11:10:39.490Z
Answers.Text: Many thanks. That works for me.
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-03T14:31:16.337Z
Answers.Text: This gets my permissions page back to functional. Many thanks.
Answers.UserDisplayName: remonds
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-03T10:38:23.110Z
Answers.LastActivityDate: 2024-07-03T10:38:23.110Z
Answers.UserDisplayName: Demerit
Body: <p><strong>Summary</strong>:</p>
  <p>Error in Drupal permissions page (admin/people/permissions/module/civicrm) after fresh install of CiviCRM 5.74.4:</p>
  <blockquote>
  <p><em>InvalidArgumentException</em>: &quot;0&quot; is an invalid render array key. Value
  should be an array but got a string. in
  Drupal\Core\Render\Element::children() (line 97 of
  core/lib/Drupal/Core/Render/Element.php).</p>
  </blockquote>
  <p><strong>Details</strong>:</p>
  <p>I have a fresh installation of Drupal 10.3.0 with PHP 8.2.20 on ddev v1.23.3. Only default core modules are enabled. No custom modules.
  I followed all the instructions on  <a href="https://docs.civicrm.org/installation/en/latest/drupal/#drupal10-download" rel="nofollow noreferrer">https://docs.civicrm.org/installation/en/latest/drupal/#drupal10-download</a> to &quot;Get the code for Drupal 10&quot;.</p>
  <p>In WSL2, I did this to add the latest CiviCRM version to D10:</p>
  <pre><code>  cd ~proj/websitename
    ddev composer require civicrm/civicrm-{core,packages,drupal-8}
    ddev composer require civicrm/cli-tools
  </code></pre>
  <p>This worked perfectly. Two modules were installed, but not yet enabled: civicrm and civicrmtheme.</p>
  <p>Next, in order to enable both modules:</p>
  <pre><code>  ddev ssh
  </code></pre>
  <p>and then, in directory /var/www/html$,</p>
  <pre><code>  cv core:install --cms-base-url=https://websitename.ddev.site/
  </code></pre>
  <p>This works <em>almost</em> perfectly. All CiviCRM functionalities seem to work. All Drupal functionalities work as well, <strong>except for one:</strong> <code>https://websitename.ddev.site/admin/people/permissions/module/civicrm.</code> This page shows the following error:</p>
  <blockquote>
  <p><em>InvalidArgumentException</em>: &quot;0&quot; is an invalid render array key. Value
  should be an array but got a string. in
  Drupal\Core\Render\Element::children() (line 97 of
  core/lib/Drupal/Core/Render/Element.php).</p>
  <p>and a lot of lines of code which I can provide if necessary.</p>
  </blockquote>
  <p>The error doesn't show up with any of the other modules. It does also show up however with <code>https://websitename.ddev.site/admin/people/permissions.</code>
  Before <code>cv core: install</code>, this error didn't show up.</p>
  <p><strong>What I have tried</strong>:</p>
  <p>line 82 to 98 of core/lib/Drupal/Core/Render/Element.php contain the following code:</p>
  <pre><code>82 if (is_array($value)) {
       ...
  93 }
  94 // comment
  95 // comment
  96 elseif (isset($value)) {
  97   throw new \InvalidArgumentException(sprintf('&quot;%s&quot; is an invalid render array key. Value should be an array but got a %s.', $key, gettype($value)));
  98 }
  </code></pre>
  <p>When line 97 is commented out, the problem disappears. This is obviously not the final solution.
  I guess the cause of the problem lies in the code for which <code>is_array($value) is false</code>. I suppose this occurs somewhere in the civicrm code. Unfortunatly I am unable to track it down.</p>
  <p>Can someone offer some help or guidance please?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-03T10:04:28.730Z
Comments.Text: I'm seeing the same error on a D10/Civi site that I've just updated to the same versions: Drupal 10.3 and Civi 5.74.4. The site seems to work, although I get a fatal error at admin/people/permissions. I've spent the last couple of days trying to track this down as a Drupal error without success, so knowing that it is being triggered by CiviCRM is a step forward.
Comments.UserDisplayName: Graham
Tags: <drupal><permissions><installation><error-page>
Title: Drupal 10 error after installation of CiviCRM
ThreadText: # Drupal 10 error after installation of CiviCRM
  
  (Asked by: username_0 on 2024-07-03)
  
  **Summary**:
  
  Error in Drupal permissions page (admin/people/permissions/module/civicrm) after fresh install of CiviCRM 5.74.4:
  
  > *InvalidArgumentException*: "0" is an invalid render array key. Value
  > should be an array but got a string. in
  > Drupal\Core\Render\Element::children() (line 97 of
  > core/lib/Drupal/Core/Render/Element.php).
  
  **Details**:
  
  I have a fresh installation of Drupal 10.3.0 with PHP 8.2.20 on ddev v1.23.3. Only default core modules are enabled. No custom modules.
  I followed all the instructions on <https://docs.civicrm.org/installation/en/latest/drupal/#drupal10-download> to "Get the code for Drupal 10".
  
  In WSL2, I did this to add the latest CiviCRM version to D10:
  
  ```
    cd ~proj/websitename
    ddev composer require civicrm/civicrm-{core,packages,drupal-8}
    ddev composer require civicrm/cli-tools
  
  ```
  
  This worked perfectly. Two modules were installed, but not yet enabled: civicrm and civicrmtheme.
  
  Next, in order to enable both modules:
  
  ```
    ddev ssh
  
  ```
  
  and then, in directory /var/www/html$,
  
  ```
    cv core:install --cms-base-url=https://websitename.ddev.site/
  
  ```
  
  This works *almost* perfectly. All CiviCRM functionalities seem to work. All Drupal functionalities work as well, **except for one:** `https://websitename.ddev.site/admin/people/permissions/module/civicrm.` This page shows the following error:
  
  > *InvalidArgumentException*: "0" is an invalid render array key. Value
  > should be an array but got a string. in
  > Drupal\Core\Render\Element::children() (line 97 of
  > core/lib/Drupal/Core/Render/Element.php).
  >
  > and a lot of lines of code which I can provide if necessary.
  
  The error doesn't show up with any of the other modules. It does also show up however with `https://websitename.ddev.site/admin/people/permissions.`
  Before `cv core: install`, this error didn't show up.
  
  **What I have tried**:
  
  line 82 to 98 of core/lib/Drupal/Core/Render/Element.php contain the following code:
  
  ```
  82 if (is_array($value)) {
       ...
  93 }
  94 // comment
  95 // comment
  96 elseif (isset($value)) {
  97   throw new \InvalidArgumentException(sprintf('"%s" is an invalid render array key. Value should be an array but got a %s.', $key, gettype($value)));
  98 }
  
  ```
  
  When line 97 is commented out, the problem disappears. This is obviously not the final solution.
  I guess the cause of the problem lies in the code for which `is_array($value) is false`. I suppose this occurs somewhere in the civicrm code. Unfortunatly I am unable to track it down.
  
  Can someone offer some help or guidance please?
  
  **Tags:** drupal, permissions, installation, error-page
  
  > **Comments:**
  > **username_1**: I'm seeing the same error on a D10/Civi site that I've just updated to the same versions: Drupal 10.3 and Civi 5.74.4. The site seems to work, although I get a fatal error at admin/people/permissions. I've spent the last couple of days trying to track this down as a Drupal error without success, so knowing that it is being triggered by CiviCRM is a step forward.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-07-03. Score: 2 | Accepted answer
  
  This is fixed in <https://github.com/civicrm/civicrm-drupal-8/pull/94>.
  
  5.74 backport at <https://github.com/civicrm/civicrm-drupal-8/pull/96>
  
  > **Comments:**
  > **username_1**: Many thanks. That works for me.  
  > **username_0**: This gets my permissions page back to functional. Many thanks.  
  
  ---
  
  