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

Files without an extension in site/users cause an exception #1583

Closed
jackwakefield opened this Issue Sep 1, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@jackwakefield

jackwakefield commented Sep 1, 2017

Expected behaviour

Only YAML files are parsed within the users directory.

Actual behaviour

Ran git init within the users directory, ran into issues with UsersDriver->isMatchingFile and the git meta files not having extensions.

Steps to reproduce

  1. Clear the stache
  2. Create a file named test in site/users or run git init within the directory
  3. Visit site and be presented with the exception

Server Details

Operating System: CentOS 6.9

Web Server: Apache 2.4

PHP Version: 7.1.7

Statamic Version: 2.6.8

Updated from an older Statamic or fresh install: Updated

List of installed addons: Custom project-specific addons

Logs

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

ErrorException in UsersDriver.php line 36:
Undefined index: extension
in UsersDriver.php line 36
at HandleExceptions->handleError('8', 'Undefined index: extension', '/var/www/html/statamic/core/Stache/Drivers/UsersDriver.php', '36', array('file' => array('type' => 'file', 'path' => 'test', 'timestamp' => '1504280233', 'size' => '0', 'dirname' => '', 'basename' => 'test', 'filename' => 'test'))) in UsersDriver.php line 36
at UsersDriver->isMatchingFile(array('type' => 'file', 'path' => 'test', 'timestamp' => '1504280233', 'size' => '0', 'dirname' => '', 'basename' => 'test', 'filename' => 'test')) in Traverser.php line 109
at Traverser->Statamic\Stache\{closure}(array('type' => 'file', 'path' => 'test', 'timestamp' => '1504280233', 'size' => '0', 'dirname' => '', 'basename' => 'test', 'filename' => 'test'))
at array_filter(array(array(...)) in Collection.php line 202
at Collection->filter(object(Closure)) in Traverser.php line 110
at Traverser->setAllFiles() in Traverser.php line 57
at Traverser->traverse() in UpdateManager.php line 115
at UpdateManager->createTraverser(object(UsersDriver)) in UpdateManager.php line 48
at UpdateManager->Statamic\Stache\{closure}(object(UsersDriver), 'users') in Collection.php line 135
at Collection->each(object(Closure)) in UpdateManager.php line 63
at UpdateManager->update() in Manager.php line 76
at Manager->update() in StacheServiceProvider.php line 160
at StacheServiceProvider->updateStache() in StacheServiceProvider.php line 142
at StacheServiceProvider->boot(object(Request))
at call_user_func_array(array(object(StacheServiceProvider), 'boot'), array(object(Request))) in Container.php line 507
at Container->call(array(object(StacheServiceProvider), 'boot')) in Application.php line 734
at Application->bootProvider(object(StacheServiceProvider)) in Application.php line 717
at Application->Illuminate\Foundation\{closure}(object(StacheServiceProvider), '33')
at array_walk(array(object(EventServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(ControllerServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(FoundationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ValidationServiceProvider), object(ViewServiceProvider), object(AppServiceProvider), object(CollectionsServiceProvider), object(ServiceProvider), object(DataServiceProvider), object(FilesystemServiceProvider), object(EventServiceProvider), object(RouteServiceProvider), object(BladeServiceProvider), object(BasketServiceProvider), object(ControlPanelServiceProvider), object(HtmlMinifyServiceProvider), object(OrderServiceProvider), object(SentryServiceProvider), object(SiteLocationServiceProvider), object(AddonServiceProvider), object(EmailServiceProvider), object(ValidationServiceProvider), object(ServiceProvider), object(CacheServiceProvider), object(StacheServiceProvider), object(GlideServiceProvider), object(ServiceProvider), object(RedisServiceProvider), object(TranslationServiceProvider)), object(Closure)) in Application.php line 718
at Application->boot() in BootProviders.php line 17
at BootProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Statamic\Bootstrap\UpdateConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 222
at Kernel->bootstrap() in Kernel.php line 117
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment