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

[BUG] Wrong site used in link plugin #196

Closed
adrien-delhorme opened this issue Mar 14, 2024 · 2 comments
Closed

[BUG] Wrong site used in link plugin #196

adrien-delhorme opened this issue Mar 14, 2024 · 2 comments
Labels
bug Something isn't working easy pickings Simple tasks

Comments

@adrien-delhorme
Copy link

Describe the bug

When using a LinkPlugin inside a static placeholder, the wrong (django) site is used when generating the link to a page located on another (django) site.

To Reproduce
Consider a multi-site setup of django-cms: Site A and Site B.

On Site A

There is a page "Page A" site-a.com/path/to/page-a/.

On Site B

We create a LinkPlugin inside a static placeholder (or in a model's PlaceholderField like a djangocms-blog Post).
We choose "Site A > Page A" in the internal page field.
The generated link points to site-b.com/path/to/page-a/ (it does not exist).

Expected behavior
The generated link must point to site-a.com/path/to/page-a/

Desktop (please complete the following information):

  • OS: OSX
  • Browser: Firefox
  • Version: 123.0.1

Additional context
The link is correct when I remove and cms_page is not None in this condition:

if getattr(ref_page, "node", None) and cms_page is not None:

@fsbraun fsbraun added bug Something isn't working easy pickings Simple tasks labels Mar 14, 2024
@fsbraun
Copy link
Member

fsbraun commented Mar 14, 2024

Going through the logic, your suggestion seems right. Thanks for pointing this out!

fsbraun added a commit to fsbraun/djangocms-frontend that referenced this issue Mar 14, 2024
@fsbraun
Copy link
Member

fsbraun commented Apr 9, 2024

Fixed in #195

@fsbraun fsbraun closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy pickings Simple tasks
Projects
None yet
Development

No branches or pull requests

2 participants