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

Saving a taxonomy throws an exception when search auto indexing is enabled #1070

Closed
dannyuk1982 opened this Issue Oct 27, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@dannyuk1982

dannyuk1982 commented Oct 27, 2016

Expected behaviour

Not break the site

Actual behaviour

The site and CP breaks - on 2.13 and 2.16

Steps to reproduce

  1. Add a new taxonomy term
  2. This error appears as a JS dialog
    There was a problem saving the data. Please check your logs.
  3. The site and CP display
Whoops, looks like something went wrong.

1/1
FatalThrowableError in TermsService.php line 27:
Call to a member function getItem() on null

Server configuration

Operating system:

Web server:

PHP version:

Statamic version:

Updated from an older Statamic or fresh install:

List of installed addons:

Logs

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

[2016-10-27 08:38:57] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getItem() on null in /home/themightycreativ/public_html/statamic/core/Data/Services/TermsService.php:27
Stack trace:
#0 /home/themightycreativ/public_html/statamic/core/API/Term.php(27): Statamic\Data\Services\TermsService->id('1bd220e9-2090-4...')
#1 /home/themightycreativ/public_html/statamic/core/Data/Content/ContentCollection.php(162): Statamic\API\Term::find('1bd220e9-2090-4...')
#2 /home/themightycreativ/public_html/statamic/core/Data/Taxonomies/Term.php(168): Statamic\Data\Content\ContentCollection->filterByTaxonomy('1bd220e9-2090-4...')
#3 /home/themightycreativ/public_html/statamic/core/Data/Taxonomies/Term.php(314): Statamic\Data\Taxonomies\Term->collection()
#4 /home/themightycreativ/public_html/statamic/core/Data/Taxonomies/Term.php(330): Statamic\Data\Taxonomies\Term->count()
#5 /home/themightycreativ/public_html/statamic/core/Data/Data.php(582): Statamic\Data\Taxonomies\Term->supplement()
#6 /home/themightycreativ/public_html/statamic/bundles/Search/SearchListener.php(57): Statamic\Data\Data->toArray()
#7 [internal function]: Statamic\Addons\Search\SearchListener->insert(Object(Statamic\Events\Stache\RepositoryItemInserted))
#8 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array(Array, Array)
#9 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(355): Illuminate\Events\Dispatcher->fire('Statamic\\Events...', Array, false)
#10 /home/themightycreativ/public_html/statamic/core/Stache/Repository.php(259): event(Object(Statamic\Events\Stache\RepositoryItemInserted))
#11 /home/themightycreativ/public_html/statamic/core/Stache/AggregateRepository.php(256): Statamic\Stache\Repository->setItem('1bd220e9-2090-4...', Object(Statamic\Data\Taxonomies\Term))
#12 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(251): Statamic\Stache\AggregateRepository->setItem('1bd220e9-2090-4...', Object(Statamic\Data\Taxonomies\Term))
#13 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\Updater->Statamic\Stache\{closure}(Array, 0)
#14 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(255): Illuminate\Support\Collection->each(Object(Closure))
#15 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(268): Statamic\Stache\Updater->updateItems(Object(Illuminate\Support\Collection), 'authors')
#16 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\Updater->Statamic\Stache\{closure}(Object(Illuminate\Support\Collection), 'authors')
#17 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(285): Illuminate\Support\Collection->each(Object(Closure))
#18 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(138): Statamic\Stache\Updater->updateAggregate()
#19 /home/themightycreativ/public_html/statamic/core/Stache/Updater.php(109): Statamic\Stache\Updater->updateDefault()
#20 /home/themightycreativ/public_html/statamic/core/Stache/UpdateManager.php(55): Statamic\Stache\Updater->update()
#21 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Support/Collection.php(135): Statamic\Stache\UpdateManager->Statamic\Stache\{closure}(Object(Statamic\Stache\Drivers\TermsDriver), 'terms')
#22 /home/themightycreativ/public_html/statamic/core/Stache/UpdateManager.php(63): Illuminate\Support\Collection->each(Object(Closure))
#23 /home/themightycreativ/public_html/statamic/core/Stache/Manager.php(79): Statamic\Stache\UpdateManager->update()
#24 /home/themightycreativ/public_html/statamic/core/Providers/StacheServiceProvider.php(138): Statamic\Stache\Manager->update()
#25 [internal function]: Statamic\Providers\StacheServiceProvider->boot(Object(Illuminate\Http\Request))
#26 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#27 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->call(Array)
#28 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(717): Illuminate\Foundation\Application->bootProvider(Object(Statamic\Providers\StacheServiceProvider))
#29 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Statamic\Providers\StacheServiceProvider), 25)
#30 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(718): array_walk(Array, Object(Closure))
#31 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#32 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Statamic\Application))
#33 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(222): Illuminate\Foundation\Application->bootstrapWith(Array)
#34 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(117): Illuminate\Foundation\Http\Kernel->bootstrap()
#35 /home/themightycreativ/public_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#36 /home/themightycreativ/public_html/index.php(155): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#37 {main}  

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Oct 27, 2016

Further information:

  • Deleting local/storage/framework/cache fixes it (until the next term is added)
  • caching.yaml is
stache_always_update: true
static_caching_enabled: false
static_caching_type: cache
static_caching_file_path: static
static_caching_ignore_query_strings: false
static_caching_exclude: [ ]
static_caching_invalidation:
  collections: STUFF HERE
  • Breaks on both Zend and Algolia
  • Behaves the same using the taxonomy fieldtype to add inline
  • In the log pasted above 1bd220e9-2090-4... is the ID of the new taxonomy
@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Oct 27, 2016

Show me that taxonomy term.

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Oct 27, 2016

it does it for any new one, here is an example

becky-rose.md

title: Becky Rose
id: 1bd220e9-2090-4ad4-ab8e-9e81816703bc
@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Oct 27, 2016

#1066 seems related

@pmeissner

This comment has been minimized.

pmeissner commented Oct 27, 2016

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Oct 27, 2016

This is fixed for the next release.

@jasonvarga jasonvarga changed the title from Serious bug: saving a new taxonomy breaks entire site & CP to Saving a taxonomy throws an exception when search auto indexing is enabled Oct 27, 2016

@jasonvarga jasonvarga closed this Oct 27, 2016

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