menu-bundle icon indicating copy to clipboard operation
menu-bundle copied to clipboard

[RFC] PhpcrProvider refactoring

Open dantleech opened this issue 9 years ago • 5 comments

Fixes #255 Based on #256

WIP.

This PR refactors the PhpcrMenuProvider to throw errors more often.

The current problem is that has was hiding all of the Exceptions which were happening in the find method and interpreting then as "menu not found".

I think the only time it should return false is when the menu document was not found. If the menu was found and it subsequently encountered another problem, then we should throw an exception.

F.e. if the menu document does not implement ItemInterface, then what is it doing at the menu basepath ? The most likely scenario is that the developer forgot to add the ItemInterface to the document.

It does alot of reorganizing, making the code easier to understand (I hope!).

dantleech avatar May 22 '16 17:05 dantleech

great job, so much better!

i guess we should add a note to the changelog to explain, in case somebody was working around strange data in their repository and now getting the clearer exceptions and being confused by them.

dbu avatar May 23 '16 07:05 dbu

can you rebase on master so we see what really changes in the test? i just merged #256

dbu avatar May 23 '16 07:05 dbu

Rebased, but is likely now taking the wrong approach as we are discussing in #254

dantleech avatar May 23 '16 08:05 dantleech

This one and its issue is tagged with milesonte for version 2.2. Do we need that?

ElectricMaxxx avatar Dec 19 '16 06:12 ElectricMaxxx

Anything going on here?

ElectricMaxxx avatar May 16 '18 03:05 ElectricMaxxx