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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entity_share-3332394-2.patch | 765 bytes | benstallings |
Issue fork entity_share-3332394
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
Comment #2
benstallings commentedfixing attribution
Comment #3
grimreaperComment #4
grimreaperHi,
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.
Comment #5
grimreaperComment #8
grimreaper