contributte / menu-control

πŸ” Menu and breadcrumb components for Nette framework (@nette)
MIT License
28 stars 20 forks source link

Service 'menu.component.menu' has already been added. #25

Closed michaljurecko closed 7 years ago

michaljurecko commented 7 years ago

Hi,

I have installed the latest version 2.0.

I created a configuration like in the example:

menu:
  front:
    items:
      Home:
        action: :Front:Home:default
      Books:
        link: '#'
        items:
          All:
            action: :Front:Books:all
          Featured:
            action: :Front:Books:featured
  admin:
    items:
      Users:
        action: :Admin:Users:default
      Books:
        action: :Admin:Books:default

And I receive error: Service 'menu.component.menu' has already been added. ----> Tracy report <----

The problem is probably resolved by commit: 2324df0a506748585b55c76c4656f0289a5a2953

Do you plan release a new stable version that fixes the bug?

I went according to the example and it would not work. If I only started with Nette, I would probably have tried some other extension right away.

It would help to add some tests of DI extension to prevent such bugs (I can prepare PR if you are interested).

I've been using your extension for a long time, and it's a very good thing!

davidkudera commented 7 years ago

Hello, first thanks for using this library and reporting this problem 😺

You are correct that your issue was already solved, I only didn't tag a new version... Until now πŸ˜‰ , so you can try to install version 2.1.0.

If you're wiling to send some more tests I'll be more than thankfull. If you want, you can look at the tests we had in version 1 and maybe take some inspiration there: https://github.com/Carrooi/Nette-Menu/blob/1.1.1/tests/DKTests/Menu/Extension.phpt

michaljurecko commented 7 years ago

Great. It works. Thanks for the quick answer. I'm going to look at those tests.