New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save fieldset containing an existing Bard field #1807

Closed
sembogaarts opened this Issue Feb 27, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@sembogaarts

sembogaarts commented Feb 27, 2018

Actual behaviour

When I try to save a fieldset with an existing Bard field I get an error in the console and log. When I create a new fieldset with a Bard field in it, everything works fine.

Steps to reproduce

  1. Add a Bard field to a fieldset
  2. Enter default things and save it
  3. Edit the field or try to save it

Server Details

Operating System:
macOS High Sierra 10.13.2

Web Server:
nginx/1.12.1

PHP Version:
PHP 7.1.8

Statamic Version:
2.8.7

Updated from an older Statamic or fresh install:

Fresh install

Logs

If any logs (browser, server, or Statamic) are appropriate...

Uncaught (in promise) TypeError: t.iter is not a function
    at Sn (jabbascripts.js?v=2.8.7:17)
    at Ji (jabbascripts.js?v=2.8.7:18)
    at new Ko (jabbascripts.js?v=2.8.7:19)
    at Ko (jabbascripts.js?v=2.8.7:19)
    at YamlFieldtype.ready (jabbascripts.js?v=2.8.7:7)
    at YamlFieldtype.Sn.t._callHook (johnny-deps.js?v=2.8.7:6)
    at YamlFieldtype.e (johnny-deps.js?v=2.8.7:7)
    at YamlFieldtype.n (johnny-deps.js?v=2.8.7:6)
    at YamlFieldtype.Rn.t.$emit (johnny-deps.js?v=2.8.7:6)
    at YamlFieldtype.Sn.t._callHook (johnny-deps.js?v=2.8.7:6)
[2018-02-27 15:16:00] production.ERROR: ErrorException: substr_count() expects parameter 1 to be string, array given in /Users/*/PhpstormProjects/*/statamic/bundles/Yaml/YamlFieldtype.php:28
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'substr_count() ...', '/Users/*...', 28, Array)
#1 /Users/*/PhpstormProjects/*/statamic/bundles/Yaml/YamlFieldtype.php(28): substr_count(Array, '\n')
#2 /Users/*/PhpstormProjects/*/statamic/core/Http/Controllers/FieldsetController.php(292): Statamic\Addons\Yaml\YamlFieldtype->process(Array)
#3 /Users/*/PhpstormProjects/*/statamic/core/Http/Controllers/FieldsetController.php(467): Statamic\Http\Controllers\FieldsetController->process(Array)
#4 /Users/*/PhpstormProjects/*/statamic/core/Http/Controllers/FieldsetController.php(260): Statamic\Http\Controllers\FieldsetController->prepareFieldset('page_default', Array)
#5 [internal function]: Statamic\Http\Controllers\FieldsetController->update('page_default')
#6 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array(Array, Array)
#7 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction('update', Array)
#8 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\Routing\ControllerDispatcher->call(Object(Statamic\Http\Controllers\FieldsetController), Object(Illuminate\Routing\Route), 'update')
#9 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#10 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#11 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#13 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(68): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(Statamic\Http\Controllers\FieldsetController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'update')
#15 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'Statamic\\Http\\C...', 'update')
#16 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request))
#17 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#18 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#19 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#20 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/CP/Configurable.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 [internal function]: Statamic\Http\Middleware\CP\Configurable->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#23 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/CP/Authenticate.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 [internal function]: Statamic\Http\Middleware\CP\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#26 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/Outpost.php(48): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 [internal function]: Statamic\Http\Middleware\Outpost->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#29 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/CP/Localize.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 [internal function]: Statamic\Http\Middleware\CP\Localize->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#32 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/CP/DefaultLocale.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 [internal function]: Statamic\Http\Middleware\CP\DefaultLocale->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#35 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/CpEnabled.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 [internal function]: Statamic\Http\Middleware\CpEnabled->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#38 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#40 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#41 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(674): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#42 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#43 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(236): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#44 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#45 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#46 /Users/*/PhpstormProjects/*/statamic/core/Http/Middleware/PersistStache.php(22): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 [internal function]: Statamic\Http\Middleware\PersistStache->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#49 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#52 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#55 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#56 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#57 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#58 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#59 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#60 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#61 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#62 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#63 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#64 /Users/*/PhpstormProjects/*/statamic/core/StaticCaching/Middleware/Retrieve.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 [internal function]: Statamic\StaticCaching\Middleware\Retrieve->handle(Object(Illuminate\Http\Request), Object(Closure))
#66 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#67 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#68 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#69 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#70 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#71 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#72 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#73 /Users/*/PhpstormProjects/*/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#74 /Users/*/PhpstormProjects/*/index.php(155): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#75 /Users/*/.composer/vendor/laravel/valet/server.php(133): require('/Users/*...')
#76 {main}  

@sembogaarts sembogaarts changed the title from Can't edit Bard field to Can't save fieldset containing an existing Bard field Mar 1, 2018

@jasonvarga jasonvarga closed this Mar 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment