jazzband / wagtailmenus

An app to help you manage and render menus in your Wagtail projects more effectively
MIT License
398 stars 138 forks source link

Will there be any updates in the near future? #402

Closed matacino closed 2 years ago

matacino commented 3 years ago

Hi,

firstly: Thank you for the handy "wagtailmenus".

But at the moment this wagtail-extension becomes a cause for potential security riscs because one can't/don't want to upgrade wagtail because of:

RemovedInWagtail211Warning: wagtail.core.middleware.SiteMiddleware and the use of request.site is deprecated. Please update your code to use Site.find_for_request(request) in place of request.site, and remove wagtail.core.middleware.SiteMiddleware from MIDDLEWARE warnings.warn(

Is SiteMiddleware realy necessary?

sowinski commented 3 years ago

Any update here? I think this project is dead.

@matacino are you interested to fork this package and continue with the work?

sowinski commented 3 years ago

Fixing this problem looks quite easy. If the repo owner reads this. I can provide a commit if you will check and upload it afterwards.

matacino commented 2 years ago

@sowinski I found your fork at https://github.com/sowinski/wagtailmenus - did you/could you do a commit with the fix?

sowinski commented 2 years ago

I used @MrCordeiro fork. https://github.com/rkhleics/wagtailmenus/issues/403

Is this working for you? https://github.com/rkhleics/wagtailmenus/pull/404

Which Django version do you use currently?

MrCordeiro commented 2 years ago

Hey @matacino and @sowinski. Now we moved the package to Jazzband, we can close this issue, no?

sowinski commented 2 years ago

@MrCordeiro I have seen that they moved the package a few weeks ago. But there is still no update, correct?

MrCordeiro commented 2 years ago

@sowinski, it's not yet 100% moved. Issue #409 must be completed first.

matacino commented 2 years ago

After I could spare some time for analyzing the source code, I discovered, that the source code actually deals with the Problem in that way that it tolerates the absence of "SiteMiddleware" in falling back (or forth) to the wagtailmenus.utils get_site_from_request() in "wagtailmenus/models/menus.py":

from wagtail.core.models import Page, Site
…
from wagtailmenus.utils.misc import get_fake_request, get_site_from_request
…
class Menu:
…
    @classmethod
    def _get_site(cls, context):
        site = context.get('site')
        if isinstance(site, Site):
            return site
        request = context.get('request')
        if request is not None:
            return get_site_from_request(request)
…

So "it works for me"™© but the documentation should be adapted to a new world without SiteMiddleware.