agoat / contao-customcontentelements-bundle

Contao 4 custom content elements
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Fatal error when creating a second content element in new installation #5

Closed agoat closed 7 years ago

agoat commented 7 years ago

New contao 4 installation. Create new theme with layout and at least one content block element. Add root- und standardpage with the layout selected. Create a new content element in the article >> everything go´s fine. Create another content element >> FATAL ERROR.

agoat commented 7 years ago

After debugging it looks like the error is the result of the get parameters of the create call

https://domain/contao?do=article&table=tl_content&**id=1**&act=create&mode=1&**pid=1**&rt=...&ref=..

If there is already a content element with id=1 (what is the fact when at least one content element is created) the fields for that content elements are build and the create routine in the DC_TABLE class try to save the default values.

So we shouldn´t build the palette and fields when we create a new content element (maybe check if input('act') == 'create').

agoat commented 7 years ago

Fixed in 44099c2969bd00e9bedbe7ac7b63dc7f639f7889