django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
42 stars 20 forks source link

Link/Button admin page failed to show the list of page to select an internal link #209

Closed TLuesebrinck closed 2 months ago

TLuesebrinck commented 2 months ago

The admin page for the link button plugin don't show the list of pages. The dropdown shows only "The result could not be loaded". Clicking the drop down cuase a console error :

jquery.min.2c872dbe60f4.js:2 GET https://mydomain/@dcf-links/link:autocomplete?app_label=app&model_name=model&field_name=field 404 (Not Found)

I am not absolute certain but I think this occured after installing the latest djangocms-fontend version.

fsbraun commented 2 months ago

Sorry, I cannot reproduce the issue. The URL looks ok. Link app's ready() method registers the URL with Django. Can you check if it is registered? (It should be, since otherwise reverse would fail.)

fsbraun commented 2 months ago

PS: I plan to move the URL into the admin space soon.

TLuesebrinck commented 2 months ago

How do I do that?

One time I got this error.

[image: image.png]

Am Mi., 24. Apr. 2024 um 13:23 Uhr schrieb Fabian Braun < @.***>:

Sorry, I cannot reproduce the issue. The URL looks ok. Link app's ready() method registers the URL with Django. Can you check if it is registered? (It should be, since otherwise reverse would fail.)

— Reply to this email directly, view it on GitHub https://github.com/django-cms/djangocms-frontend/issues/209#issuecomment-2074716221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWMV5NUXOSG4WDQ3SW2RXVDY66I3VAVCNFSM6AAAAABGWSCZVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZUG4YTMMRSGE . You are receiving this because you authored the thread.Message ID: @.***>

fsbraun commented 2 months ago

For example, by using django-extensions and ./manage.py show_urls.

TLuesebrinck commented 2 months ago

The command line output this warning message: I have not seen this before, could this be part of the problem?

python manage.py show_urls /usr/share/django-cms/env/lib/python3.11/site-packages/django/db/backends/utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported. warnings.warn(self.APPS_NOT_READY_WARNING_MSG, category=RuntimeWarning)

I can find the link in the command output: @.***/link:autocomplete djangocms_frontend.contrib.link.views.AutocompleteJsonView dcf_autocomplete:ac_view

But when I test the link in the browser, it is unknown

^(?P.+.html) ^(?P.+.mp4)$ sitemap.xml sitemap.xml taggit_autosuggest/ robots.txt en/ ^media/(?P.)$ ^static/(?P.)$ The current path, @dcf-links/link:autocomplete, didn’t match any of these.

Am Mi., 24. Apr. 2024 um 14:40 Uhr schrieb Fabian Braun < @.***>:

For example, by using django-extensions and ./manage.py show_urls.

— Reply to this email directly, view it on GitHub https://github.com/django-cms/djangocms-frontend/issues/209#issuecomment-2074854958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWMV5NVYC6BPJNL5AMTVTOLY66R4BAVCNFSM6AAAAABGWSCZVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZUHA2TIOJVHA . You are receiving this because you authored the thread.Message ID: @.***>

fsbraun commented 2 months ago

I have not looked at the issue for now, but instead moved the autocomplete view into the admin (which I had planned for a while). Can you check if you're ok with version 1.3.2?

TLuesebrinck commented 2 months ago

Yes, with version 1.3.2, the internal link dropdown it is working again.