Problem/Motivation

The ImportContext->setRemoteChannelCount() method requires its parameter to be a string, but the PullForm->importChannel() method submits $storage['remote_channel_count'] without ensuring that it is a string.

Steps to reproduce

I'm not sure why my site has an integer stored in that variable, but it doesn't seem like an unreasonable way to count remote channels. :shrug:

Proposed resolution

In PullForm->importChannel(), add a type hint to change $storage['remote_channel_count'] to a string before submitting it to ImportContext->setRemoteChannelCount().

Remaining tasks

make a patch.

CommentFileSizeAuthor
#2 entity_share-3332394-2.patch765 bytesbenstallings
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

BenStallings created an issue. See original summary.

benstallings’s picture

Status: Active » Needs review
StatusFileSize
new765 bytes

fixing attribution

grimreaper’s picture

Version: 8.x-3.0-rc4 » 8.x-3.x-dev
Assigned: Unassigned » grimreaper
grimreaper’s picture

Status: Needs review » Needs work

Hi,

Nice catch!

This comes from $json['meta']['count'], so it depends of the type of count in the JSON API response on the server website.

I have tested and in my case it is an int and I reproduce the error.

I guess this is the type of $remoteChannelCount in the ImportContext that should be changed to int, this is way more logical.

I think at the time I wrote that, I used a string for the if (empty) statement in ImportService.

So I will provide a MR that change the type of the property and so the getter etc. And force a type int when getting the value from JSON API response.

grimreaper’s picture

Title: $remote_channel_count must be string, int given » Change $remote_channel_count to int

  • Grimreaper committed 887489cc on 8.x-3.x
    Issue #3332394 by BenStallings, Grimreaper: Change $remote_channel_count...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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