jazzband / wagtailmenus

An app to help you manage and render menus in your Wagtail projects more effectively

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will there be any updates in the near future?

matacino opened this issue · comments

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?

Any update here? I think this project is dead.

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

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.

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

I used @MrCordeiro fork.
#403

Is this working for you?
#404

Which Django version do you use currently?

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

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

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

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.