- Issue created by @fathimathsajila
- First commit to issue fork.
- Merge request !5Issue #3355760: Error: Call to a member function getFileUri() on array in paragraphs_browser_paragraph_type_form_builder() → (Closed) created by Ranjit1032002
- Status changed to Needs review
over 1 year ago 7:17am 24 April 2023 - 🇮🇳India Ranjit1032002
Created MR!5 for the issue mentioned, please review.
Thank You. - 🇺🇸United States texas-bronius
Two cents here - - I experienced the same error uploading an image to use for Paragraphs Browser, and applying the patch https://git.drupalcode.org/project/paragraphs_browser/-/merge_requests/5... from #3 above does overcome that error, but I then see another error:
```
TypeError: mb_strlen(): Argument #1 ($string) must be of type string, array given in mb_strlen() (line 333 of /app/public_html/core/lib/Drupal/Core/Form/FormValidator.php)
#0 /app/public_html/core/lib/Drupal/Core/Form/FormValidator.php(333): mb_strlen(Array)
...
```Related or not, I don't know, but when I forgo this nice image upload method and instead plop the img right into, say, a custom themes path, I can let the image file convey with code/config: win-win!
- 🇺🇸United States daveferrara1
Here is a patch. the "...mb_strlen()" WSOD is because in ln333 since the #maxlength check is truthy, #value is assumed to be a string. The maxlength is set in form_alter of the module on the file field. Here is a patch that updates the file field and includes what is unmerged in the pull request that was opened to add a check for "instanceof \Drupal\file\Entity\File".
There was also another issue with the uriScheme from Issue 3284847 🐛 Error: Call to undefined method Drupal\Core\File\FileSystem::uriScheme() RTBC and this patch adds some reorg/linting at the top.
- Status changed to RTBC
about 1 year ago 8:33pm 2 October 2023 - 🇺🇸United States mndonx
This patch worked for me too, thank you!
To test:
- Edited a paragraph
- Tried to upload a Paragraph Browser image (under "Paragraphs Browser Settings")
- Got the error described in the issue
- Checked to see if the image got added anyway (it did not)
- Applied the patch
- Tried uploading a paragraph browser image again
- This time it worked with no error
- Ensured that the image now appears when adding a new paragraph to a page in the Paragraph BrowserChanging status to RTBC.
- 🇺🇸United States greggles Denver, Colorado, USA
Adding credit for stefvanlooveren who proposed part of the fix here before this issue was created over in 🐛 Error: Call to undefined method Drupal\Core\File\FileSystem::uriScheme() RTBC . I'm marking that as a duplicate of this one since this has more folks and fixes more issues.
- 🇺🇸United States greggles Denver, Colorado, USA
@daveferrarra1 would you consider making your patch into changes in the MR?
- First commit to issue fork.
- 🇫🇮Finland YevKo Espoo
MR doesn't work and produces the same error TypeError: mb_strlen(): mentioned in #5
- First commit to issue fork.
-
bvoynick →
committed 38f1c4b3 on 8.x-1.x
Issue #3355760 by stefvanlooveren, daveferrara1, ranjit1032002, texas-...
-
bvoynick →
committed 38f1c4b3 on 8.x-1.x