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

PageChooserPanel displays selected page title instead of custom get_admin_display_title #5726

Closed
bogdangoie opened this issue Nov 29, 2019 · 4 comments

Comments

@bogdangoie
Copy link

bogdangoie commented Nov 29, 2019

Issue Summary

PageChooserPanel displays selected page title instead of custom get_admin_display_title value.
When I click to select a page, the chooser displays correctly the custom get_admin_display_title in the list of pages.

When I select the page desired from the chooser, the chosen page title doesn't display the expected value of get_admin_display_title. Instead, it displays the page title which I think it's a bug.

I had a look at wagtail/admin/templates/wagtailadmin/widgets/page_chooser.html and it should display the get_admin_display_title right?

Steps to Reproduce

  1. Have a page with a custom get_admin_display_title
  2. Have another page with a PageChooserPanel
  3. Use the PageChooserPanel in the admin to select the page with custom get_admin_display_title. Once selected, the title of the page displayed is the page title instead of get_admin_display_title value

Technical details

  • Python version: 3.7.3
  • Django version: 2.2.7
  • Wagtail version: 2.7
  • Browser version: Chrome 78
@SaptakS
Copy link
Contributor

SaptakS commented Dec 26, 2019

@bogdangoie @gasman I think the reason for this thing is this commit. According to this commit, it seems to me as intentional to show the actual title that gets shown to end user and not the admin title so that the admin knows what the title will be to the end user.

@gasman
Copy link
Collaborator

gasman commented Dec 26, 2019

@SaptakS We do want to use the real title as the link text within rich text fields, but PageChooserPanel should use get_admin_display_title. It may be that the link element in _page_title_choose.html needs to include both versions of the title as data- attributes, so that we can return both of them to the calling code (whether that's the rich text field or the page chooser widget) so that it can choose the appropriate one.

@SaptakS
Copy link
Contributor

SaptakS commented Dec 27, 2019

@gasman makes sense. I will give the code a shot and see if I can send a PR for the same.

@gasman
Copy link
Collaborator

gasman commented Sep 28, 2020

Fixed in #5745

@gasman gasman closed this as completed Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants