Skip to content

ItemNotFoundException Thrown for Newly Created Settings Until First Access #2774

@abidkhan484

Description

@abidkhan484

Description

Newly created settings throw an ItemNotFoundException if they haven’t been accessed at least once after creation.

Steps to reproduce

  1. Create a new settings blade file. e.g: resources/views/twill/settings/site-settings/hubspot.blade.php
  2. Without accessing the settings page, visit any content

Expected result

It should handle the data accordingly.

Actual result

It's currently returning the below error.

[previous exception] [object] (Illuminate\\Support\\ItemNotFoundException(code: 0):  at /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:1433)

[stacktrace]

#0 /var/www/html/vendor/area17/twill/src/TwillAppSettings.php(111): Illuminate\\Support\\Collection->firstOrFail()

#1 /var/www/html/vendor/area17/twill/src/TwillAppSettings.php(68): A17\\Twill\\TwillAppSettings->getGroupDataForSectionAndName()

#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(361): A17\\Twill\\TwillAppSettings->get()

#3 /var/www/html/vendor/area17/twill/src/Services/Blocks/BladeCompiler.php(32) : eval()'d code(5): Illuminate\\Support\\Facades\\Facade::__callStatic()

#4 /var/www/html/vendor/area17/twill/src/Services/Blocks/BladeCompiler.php(32): eval()

#5 /var/www/html/vendor/area17/twill/src/Services/Blocks/BladeCompiler.php(70): A17\\Twill\\Services\\Blocks\\BladeCompiler::compile()

#6 /var/www/html/vendor/area17/twill/src/Services/Blocks/Block.php(627): A17\\Twill\\Services\\Blocks\\BladeCompiler::render()

#7 /var/www/html/storage/framework/views/fe02b681a008a749db413b7223a6c2db.php(12): A17\\Twill\\Services\\Blocks\\Block->renderForm()

Versions

Twill version: 3.4
Laravel version: 11.9
PHP version: 8.2
Database engine: Mysql 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions