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

Silence errors by renaming panels on models #471

Closed

Conversation

katdom13
Copy link

@katdom13 katdom13 commented Dec 22, 2023

When wagtailmenus is used on our sites, we usually encounter these warnings:

wagtailmenus.FlatMenu: (wagtailadmin.W002) FlatMenu.content_panels will have no effect on modeladmin editing
        HINT: Ensure that FlatMenu uses `panels` instead of `content_panels`or set up an `edit_handler` if you want a tabbed editing interface.
There are no default tabs on non-Page models so there will be no Content tab for the content_panels to render in.
wagtailmenus.FlatMenu: (wagtailadmin.W002) FlatMenu.settings_panels will have no effect on modeladmin editing
        HINT: Ensure that FlatMenu uses `panels` instead of `settings_panels`or set up an `edit_handler` if you want a tabbed editing interface.
There are no default tabs on non-Page models so there will be no Settings tab for the settings_panels to render in.
wagtailmenus.MainMenu: (wagtailadmin.W002) MainMenu.content_panels will have no effect on modeladmin editing
        HINT: Ensure that MainMenu uses `panels` instead of `content_panels`or set up an `edit_handler` if you want a tabbed editing interface.
There are no default tabs on non-Page models so there will be no Content tab for the content_panels to render in.
wagtailmenus.MainMenu: (wagtailadmin.W002) MainMenu.settings_panels will have no effect on modeladmin editing
        HINT: Ensure that MainMenu uses `panels` instead of `settings_panels`or set up an `edit_handler` if you want a tabbed editing interface.
There are no default tabs on non-Page models so there will be no Settings tab for the settings_panels to render in.

even though edit_handler IS being used on the mixin used by views correctly, just because the class variables in the internal models are in this wagtail admin model check.

I find that renaming the class variables like so in wagtailmenus silences the warnings

@MrCordeiro MrCordeiro requested a review from ababic December 22, 2023 11:32
@ababic
Copy link
Collaborator

ababic commented Dec 22, 2023

I actually think it's the check in Wagtail that is the problem. I know it's well intentioned, but it's just a bit presumptuous for my liking. If it can't know for sure that something is a problem, it shouldn't be raising warnings like this.

In regards to the approach here: We can't just go renaming key attributes. Every project I've ever used this on makes changes to these attributes and expects the existing ones to be there.

@katdom13
Copy link
Author

Thanks for the prompt response, @ababic .
I'll see if I can raise this to the Wagtail team after the holiday season.

Thanks!

@MrCordeiro MrCordeiro linked an issue Dec 22, 2023 that may be closed by this pull request
@MrCordeiro
Copy link
Contributor

Thanks for your help Kat! 🧡
If you open a new issue with the Wagtail team, please don't forget to link it either to this PR or to #464. Hopefully they can turn these warnings off.

As for now, I'll be closing the PR

@MrCordeiro
Copy link
Contributor

I'll see if I can raise this to the Wagtail team after the holiday season.

Hi @katdom13! Let us know of your progress on that front, ok?

If you do open an issue with the Wagtail team, please add a link to it on #464 so that we can follow this issue in a single place. Thanks!

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

Successfully merging this pull request may close these issues.

Wagtail 5.2 throws wagtailadmin.W002 warnings
3 participants