Problem/Motivation

Error encountered:
Error: Call to undefined method Drupal\Component\Utility\Bytes::toInt() in Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget->getUploadValidators() (line 253 of modules\contrib\video\src\Plugin\Field\FieldWidget\VideoUploadWidget.php).

Steps to reproduce

Chose Video upload instead embed video on Manage Form Display
Add a node (a content), then the following error is encountered:

Error: Call to undefined method Drupal\Component\Utility\Bytes::toInt() in Drupal\video\Plugin\Field\FieldWidget\VideoUploadWidget->getUploadValidators() (line 253 of modules\contrib\video\src\Plugin\Field\FieldWidget\VideoUploadWidget.php).

Issue fork video-3353255

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Moudeen created an issue. See original summary.

Moudeen’s picture

Can you create a patch for this?

replace Bytes::toInt() with Bytes::toNumber() or update the module

Thank you

sahil.goyal made their first commit to this issue’s fork.

Anybody’s picture

Status: Needs work » Reviewed & tested by the community

Confirming #2 is the correct solution, we had a similar issue in one of our modules.

RTBC for MR!17

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

a_mitch’s picture

Status: Reviewed & tested by the community » Needs review

Updated MR 17. There were a couple other instances of toInt() in VideoUploadWidget

keshavv’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested MR 17, Its working perfect. Ready to merge.

Anybody’s picture

Thanks @a_mitch! I indeed didn't check that, just reviewed what was done. Perfect! RTBC+1

_renify_’s picture

This also fix when saving node page https://www.drupal.org/node/3201242

lisotton’s picture

I also tested MR 17 and it is working fine.

@_renify with your patch, you are fixing things that is not related to this issue and is fixed in #3348748.

codebymikey’s picture

FileSize
1.7 KB

Addressing feedback from #13, removing the accessCheck(FALSE) call.

Anybody’s picture

Let's simply use the MR, thanks. Any maintainer?

vmarchuk’s picture

Tested MR #17 and it is working fine. RTBC+1

mmenavas’s picture

Tested patch #14 and it is working fine. RTBC+1

kristian.raychev’s picture

I also tested MR #17 and it works fine. RTBC+1

drupalfan2’s picture

+1

podarok’s picture

Version: 3.0.4 » 3.0.5
Status: Reviewed & tested by the community » Fixed

tnx

Status: Fixed » Closed (fixed)

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

_renify_’s picture