Problem/Motivation

TypeError: Drupal\quicktabs\Plugin\views\style\Quicktabs::getSetMapping(): Return value must be of type bool, array returned in Drupal\quicktabs\Plugin\views\style\Quicktabs->getSetMapping() (line 99 of modules/contrib/quicktabs/src/Plugin/views/style/Quicktabs.php).

Steps to reproduce

Update module to 4.0.1, go to a view that uses Quick Tabs.

Proposed resolution

Create a PR

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork quicktabs-3514046

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

themic8 created an issue. See original summary.

themic8’s picture

Issue summary: View changes

themic8’s picture

Title: getSetMapping(): Return value must be of type bool, array returned » TypeError, getSetMapping return value must be of type bool, array returned
Issue summary: View changes
themic8’s picture

Assigned: themic8 » Unassigned
Status: Active » Needs review
uttam’s picture

This patch resolves a TypeError in Quicktabs::getSetMapping() by changing the return type from bool to array, ensuring it accurately reflects the actual return value ($this->setMapping), which is always an array; this prevents runtime error which was occuring by type mismatch, enforces strict type safety as required in PHP 7+ and PHP 8+
Hence, Moving the state of the issue to RTBC.

uttam’s picture

Status: Needs review » Reviewed & tested by the community
uttam’s picture

joelpittet made their first commit to this issue’s fork.

  • joelpittet committed f2dce76b on 4.0.x authored by themic8
    Issue #3514046: TypeError, getSetMapping return value must be of type...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for catching that, I have committed the code.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kurt.j’s picture

StatusFileSize
new63.85 KB

Sorry, but this is not fixed. I just updated to this version and get this "value must be of type bool, array returned" error. I checked the code base for 4.0.1 and the return value is still set to bool in the getSetMapping() function code. I will apply the patch in the mean time. But just wanted to let you know that this is not fixed. Thanks!