thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

BREAD browse error on large JSON text column: mb_strlen() expects parameter 1 to be string, array given #5292

Closed damms005 closed 3 years ago

damms005 commented 3 years ago

Version information

Description

When I navigate to a BREAD's browse page, and a record has two large JSON string values (of about 2024 characters each) for a text column (text COLLATE utf8mb4_unicode_ci NOT NULL), the BREAD browse fails with the error below logged:

[2021-04-17 08:08:04] xxx.ERROR: mb_strlen() expects parameter 1 to be string, array given (View: /home/enniqnva/idvouch.com/vendor/tcg/voyager/resources/views/bread/browse.blade.php) {"view":{"view":"/home/enniqnva/idvouch.com/vendor/tcg/voyager/src/../resources/views/bread/browse.blade.php","data":{"errors":..<a really long but nothing unusual, normal dump here>}

Steps To Reproduce

  1. Create a table in the database with about 9 columns. Ensure that two out of the columns are defined as text COLLATE utf8mb4_unicode_ci NOT NULL
  2. Create BREAD for the table from Voyager
  3. Create a record that has a JSON string of about 2024 characters in each of the two text columns defined in Step # 1 above
  4. Navigate to the BREAD's browse route
  5. Error 505

Additional context

I guess the most important step in reproducing this is to ensure that at least 2 of the columns are text COLLATE utf8mb4_unicode_ci NOT NULL and a row has JSON string stored in both columns, with each of the JSON string not less than 2024 characters

MrCrayon commented 3 years ago

Duplicate of #3420

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.