我只是想使用Sonata的Classification Bundle(http://sonata-project.org/bundles/classification/2-2/doc/index.html)。
一切都很顺利,直到我进入管理面板,添加了一个类别并尝试查看列表。然后错误出现了:
Undefined index: parent in vendor/sonata-project/doctrine-orm-admin-bundle/Guesser/FilterTypeGuesser.php line 64
GitHub上似乎发布了一个bug:https://github.com/sonata-project/SonataClassificationBundle/issues/40
无论如何,我需要某种解决方案,因为我需要它尽快工作。有什么想法吗?
尝试手动将根类别插入数据库。
这里是sql:
INSERT INTO `classification__category` (`id`, `parent_id`, `context`, `name`, `enabled`, `slug`, `description`, `position`, `created_at`, `updated_at`, `media_id`) VALUES (1, NULL, 'main', 'Root', 1, 'root', NULL, 1, NOW(), NOW(), NULL);