Problem/Motivation

If an endpoint is badly configured and returns data that's not in the right format, the storage crashes:

> TypeError: Drupal\external_entities\Event\ExternalEntityTransformRawDataEvent::__construct(): Argument #2 ($raw_data) must be of type array, string given, called in /var/www/html/repos/external_entities/src/ExternalEntityStorage.php on line 320

It would be good to check $raw_data and throw a more meaningful exception.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

joachim created an issue. See original summary.

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

abhishek_gupta1’s picture

Status: Active » Needs review

@joachim, I have fixed the issue and created MR. please review it once.

  • ba47d01d committed on 3.0.x
    Issue #3455366 by abhishek_gupta1: mapFromRawStorageData() should check...
guignonv’s picture

Status: Needs review » Fixed

This has been fixed by commit ba47d01d. Thanks @abhishek_gupta1 for the fix proposal. I've adjusted your fix though because there are not only "string" that could be returned but integers and possibly other stuff as well (if we consider other clients than rest clients). Feel free to reopen the issue if the fix does not solves everything.

Status: Fixed » Closed (fixed)

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

guignonv’s picture

guignonv’s picture