Return value must be of type int, string returned

Created on 21 October 2022, over 1 year ago
Updated 16 February 2023, over 1 year ago

Problem/Motivation

Under some circumstances, the value of import_maxsize can get stored as a string rather than as an integer, resulting in this error:

TypeError: Drupal\entity_share\EntityShareUtility::getMaxSize(): Return value must be of type int, string returned in Drupal\entity_share\EntityShareUtility::getMaxSize() (line 131 of /app/web/modules/contrib/entity_share/src/EntityShareUtility.php)

I didn't succeed in tracking down the underlying problem. However, the solution is very straightforward.

Steps to reproduce

Unknown. The Import config form clearly specifies that the value should be an integer. Resubmitting the form doesn't resolve the problem once it is established; the string value persists.

Proposed resolution

Use a type hint to ensure that the return value is an integer.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024