contao-community-alliance / meta-palettes

Dynamic configured palettes for contao.
6 stars 8 forks source link

Too much recursion #37

Closed richardhj closed 6 years ago

richardhj commented 6 years ago

…with v2.0 on calling contao?do=metamodel

contao.pdf screen shot 2017-12-29 at 13 43 11

dmolineus commented 6 years ago

Are there any 3rd party extensions in use (going beyond the default mm extension stack)? Never stumbled upon it so far.

Could you provide your composer.lock file?

richardhj commented 6 years ago

Caught!

Found the fault in my code. I wrote $GLOBALS['TL_DCA']['tl_metamodel']['metapalettes']['default extends default']['+advanced'][] = 'myfield';

This looks like nonsense at the first sight, however, I wanted to save time when I have written my dca. And this was running in v1.0 😇

dmolineus commented 6 years ago

Nice idea to extend a default palette. :) V2.0 supports multiple inheritance so it runs in the recursion issue.

As your code worked but never was official supported nor an extension can trust it would work (as it easily would be overwritten) I won't fix it.

Probably add an exception to prevent self inheritance. A circular recursion can't be detected with the current implantation though.

dmolineus commented 6 years ago

Now an exception is thrown if a circular reference to the same palette name is detected (See 65fe4a0).

richardhj commented 6 years ago

👍