What are the steps required to reproduce the bug?
https://www.drupal.org/project/custom_node_write/issues/3022249
Modify an existing install file and add a description in the field:
Before:

$schema ['xx_table'] = array(
'fields' => array(
'block_id' => array(
'type' => 'serial',
'not null' => true,
),
'nid' => array(
'type' => 'int',
'not null' => true
),
),
'indexes' => array(
'nid' => array(
'nid',
),
),
'primary key' => array('block_id'),
'auto increment' => 1
);

After:
$schema ['xx_table'] = array(
'description' => 'xx_table',
'fields' => array(
'block_id' => array(
'type' => 'serial',
'not null' => true,
'description' => 'The primary key',
),
'nid' => array(
'type' => 'int',
'not null' => true
),
),
'indexes' => array(
'nid' => array(
'nid',
),
),
'primary key' => array('block_id'),
'auto increment' => 1
);

What behavior were you expecting?

No changes expected on drupal interface since no functional changes done.
The site should run normally.

What happened instead?
The site crashed with the following error:
Fatal error: Cannot unset string offsets in\includes\common.inc on line 7208

Comments

avinashHDM created an issue. See original summary.

avinashHDM’s picture

Title: Drupal crashes when module install files do not specify field descriptions in schema hook » Drupal crashes with error Cannot unset string offsets when module install files do not specify field descriptions in schema hook
ajaybmishra’s picture

Assigned: avinashHDM » ajaybmishra
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new684 bytes

Hello avinashHDM,

As you not commented anything from your side on this issue from last 6 months, so tried to give corrected patch for this error.

Please check and review it.

Status: Needs review » Needs work
ajaybmishra’s picture

Status: Needs work » Needs review

Changed the status to Needs Review.

ajaybmishra’s picture

Changed the assignment to myself.

ajaybmishra’s picture

Added company name in comments.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.