Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone not found while invoking 'render_section': Header #16478

Closed
effapp opened this issue Jul 23, 2024 · 7 comments
Closed

Zone not found while invoking 'render_section': Header #16478

effapp opened this issue Jul 23, 2024 · 7 comments

Comments

@effapp
Copy link

effapp commented Jul 23, 2024

Describe the bug

It throwed "invalidOperationException: Zone not found while invoking 'render_section': Header" when Adding Header, Footer zone again after deleting initial all of zones.

Orchard Core version

1.8.3

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Design->Settings->Zones'
  2. Delete all of zones
  3. Click on 'Save'
  4. Go to 'Design->Settings->Zones'
  5. Add zones: Header,Footer
  6. Click on 'Save'
  7. Go to Home Page
  8. See error

image

@Piedone
Copy link
Member

Piedone commented Jul 23, 2024

Can't reproduce with vanilla 1.8.3 with the Blog theme, despite changing it to have a {% render_section "Header", required: true %}.

Note that this exception is thrown if you try to render the zone with {% render_section "Header", required: true %} but the zone is empty, i.e. it doesn't have any shapes or widgets. If you want to allow empty zones, you need to render it with {% render_section "Header", required: false %}.

What do you have in your code, and what doesn't match your expectations?

@effapp
Copy link
Author

effapp commented Jul 23, 2024

Hi @Piedone,
Yes, I have changed it to have '{% render_section "Header", required: true %}' and there's a test html widget in Header Zone.

At first, it was normal, but after I deleted the Header,Footer zone, saved it, and then re-added the Header,Footer zone and added widgets to these zone, then the error occurred.

@Piedone
Copy link
Member

Piedone commented Jul 23, 2024

Can't reproduce with a widget either (having a widget in the zone causes this exception not be thrown anyway).

Please provide a screen recording of you reproducing this, starting from an empty app, and showing the whole browser window.

@effapp
Copy link
Author

effapp commented Jul 24, 2024

Hi @Piedone,
There is a abnormal appearance :
After Deleting all of zones, the widgets in the zones still exists. As follows:
steps:

  1. delete all of zones and click on 'Save'
    image

  2. Go to 'Design -> widgets', As follows:
    image

  3. Re-added zones and click on 'Save', as follows:
    image

  4. Go to 'Design -> Widgets', the previous widgets have reappeared , as follows:
    image

  5. Go to home page , error occured, as follows:
    image

  6. Delete all of widgets in zones, re-added other widgets in zones and save

  7. Go to home page , error occured, as follows:
    image

@Piedone
Copy link
Member

Piedone commented Jul 24, 2024

Thank you for the details! However, I still can't reproduce with vanilla 1.8.3 (nor do I see how this can happen with the 1.8.3 code). Could you try to reproduce it with a vanilla 1.8.3 as well, including the changes you make to e.g. the Blog theme? Or share the full solution with us, including not just the source but the DB.

@effapp
Copy link
Author

effapp commented Jul 26, 2024

I deleted the site and reinstalled it, and all the issues was resolved. Thanks.

@effapp effapp closed this as completed Jul 26, 2024
@effapp
Copy link
Author

effapp commented Jul 26, 2024

I deleted the site and reinstalled it, and all the issues was resolved. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants