enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Flatten page structure - Error for content mixing template and components #6820

Closed GlennRicaud closed 5 years ago

GlennRicaud commented 5 years ago

There seems to be a problem when displaying content with both template and components

Investigate and fix

sigdestad commented 5 years ago

Are you sure there are no changes required to the templates? Remember superhero is really old...

GlennRicaud commented 5 years ago

Yes maybe it is because the data in superhero is invalid. That is what has to be found here: if superhero was incorrect (and needs to be fixed) or if there is a case that is not handled here (and then to be fixed).

To test both existing and new behaviour, work with: 1) xp in branch masterand app-superhero-blog in branch master 2) xp in branch epic-6649and app-superhero-blog in branch issue-18

GlennRicaud commented 5 years ago

@ashklianko : I reproduced your problem of import of superhero without the components. You are right . I think I had the content with components because I imported manually and not using the DemoInitializer.

But so, this is due to the call to contentService.update in com.enonic.xp.demo.initializer.DemoInitializer in app-superhero. This call removes the other components.

But even when imported correctly /superhero is not correctly displayed.

So 2 bugs here actually:

ashklianko commented 5 years ago

Hi @GlennRicaud , found where it comes from: PageDataSerializer.getPageRegions() needs a descriptor to fetch regions (I totally forgot about it), and root node in superhero is having only a template; Thus we end up with regions not being imported properly (or imported properly and then regions wiped out with update). I've created PR for superhero: https://github.com/enonic/app-superhero-blog/pull/19 Can we say that this is expected behavior for new page structure?