serlo/serlo.org-legacy

Autoreview broken

Closed this issue · 4 comments

Currently, opening any page throws:

Fatal error: Uncaught Taxonomy\Exception\TermNotFoundException: Term with id 35607 not found in /usr/local/apache2/htdocs/src/module/Taxonomy/src/Manager/TaxonomyManager.php:310 Stack trace: #0 /usr/local/apache2/htdocs/src/module/Versioning/src/Factory/RepositoryManagerFactory.php(59): Taxonomy\Manager\TaxonomyManager->getTerm('35607') #1 [internal function]: Versioning\Factory\RepositoryManagerFactory->Versioning\Factory\{closure}('35607') #2 /usr/local/apache2/htdocs/src/module/Versioning/src/Factory/RepositoryManagerFactory.php(60): array_map(Object(Closure), Array) #3 [internal function]: Versioning\Factory\RepositoryManagerFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'versioningrepos...', 'Versioning\\Repo...') #4 /usr/local/apache2/htdocs/src/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(939): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'versioningrepos...', 'Versioning\\Repo...') #5 /usr/local/apache2/htdocs/src/vendor/zendframework/ze in /usr/local/apache2/htdocs/src/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 946

Quickfix: set $autoreview_taxonomy_term_ids to empty array:

$autoreview_taxonomy_term_ids = [];

This also happens after running yarn mysql:rollback so the dump is not up-to-date with definitions.local.php

Also: looking at the implementation, I think that the ids should be numbers (instead of the string that is currently in definitions.local.php)

Actually, the whole feature doesn't work with multiple instances: getTaxonomyTerm throws an error if you try to resolve an id from another instance.

kulla commented

Thx for the issue report. The error occurs when we are in an instance for which the taxonomy term does not exist. I have only tested the issue at http://en.serlo.localhost:4567/math/example-content However at http://de.serlo.localhost:4567/mathe we get the error -> I'll fix it...

kulla commented

Also: looking at the implementation, I think that the ids should be numbers (instead of the string that is currently in definitions.local.php)

This does not seem to be relevant. The method to which $id is passed has the signature of $id to be mixed -> I guess is automatically converted to a number in the end.