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

`fieldset` not requried for partials #2102

Closed
jcohlmeyer opened this Issue Aug 5, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@jcohlmeyer

jcohlmeyer commented Aug 5, 2018

Describe the bug
When adding a partial field to a fieldset in the CP if if you forget to select the fieldset that should be used the entire control panel breaks with an error Undefined index: fieldset

To Reproduce
Steps to reproduce the behavior:

  1. Go to the fieldset builder
  2. Add a partial field & leave out the fieldset slection
  3. Save fielset
  4. Go to any CP page

Expected behavior
Fieldset to be required and or not break entire CP if left out.

Environment details (please complete the following information):

  • Statamic Version 2.10.3
  • Fresh Install or Upgrade: Upgrade
  • OS: Ubuntu 16.04
  • Browser: Firefox
  • Web Server: Nginx, Valet
  • PHP Version: 7.1
  • Addons installed: CodeMirror, Feed, FontAwesome, Permissions, PowerTools, SeoPro, Spaceless, Spock, UniqueSvgCss, VideoEmbed

Additional context
yaml_parser: symfony

ErrorException in Fieldset.php line 237: Undefined index: fieldset (View: /var/www/groworganic.dev.jrc9.ca/statamic/resources/views/layout.blade.php) (View: /var/www/groworganic.dev.jrc9.ca/statamic/resources/views/layout.blade.php)

    in Fieldset.php line 237
    at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 44
    at PhpEngine->evaluatePath('/var/www/groworganic.dev.jrc9.ca/local/storage/framework/views/d1c882b66d906c194ebff391d36da3fe', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'update_available' => false, 'title' => 'Dashboard', 'sidebar' => false, 'widgets' => object(Collection))) in CompilerEngine.php line 58
    at CompilerEngine->get('/var/www/groworganic.dev.jrc9.ca/statamic/resources/views/dashboard.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'update_available' => false, 'title' => 'Dashboard', 'sidebar' => false, 'widgets' => object(Collection))) in View.php line 147
    at View->getContents() in View.php line 118
    at View->renderContents() in View.php line 83
    at View->render() in Response.php line 51
    at Response->setContent(object(View)) in Response.php line 202
    at Response->__construct(object(View)) in Router.php line 1229
    at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 112
    at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
    at ControllerDispatcher->callWithinStack(object(DashboardController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 68
    at ControllerDispatcher->dispatch(object(Route), object(Request), 'Statamic\Http\Controllers\DashboardController', 'index') in Route.php line 203
    at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
    at Route->run(object(Request)) in Router.php line 708
    at Router->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Authenticate.php line 62
    at Authenticate->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Outpost.php line 48
    at Outpost->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Outpost), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Localize.php line 25
    at Localize->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Localize), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in DefaultLocale.php line 28
    at DefaultLocale->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(DefaultLocale), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddHeaders.php line 19
    at AddHeaders->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddHeaders), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CpEnabled.php line 23
    at CpEnabled->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CpEnabled), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Router.php line 710
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 674
    at Router->dispatchToRoute(object(Request)) in Router.php line 635
    at Router->dispatch(object(Request)) in Kernel.php line 236
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in GenerateReport.php line 13
    at GenerateReport->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(GenerateReport), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Debugbar.php line 51
    at Debugbar->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Debugbar), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
    at VerifyCsrfToken->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
    at ShareErrorsFromSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
    at StartSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Retrieve.php line 33
    at Retrieve->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(Retrieve), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Kernel.php line 122
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
    at Kernel->handle(object(Request)) in index.php line 155
@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Oct 31, 2018

Improved the error message for next release. (I still believe there should be an error)

As for the validation, we'll handle that in v3.

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