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

Issue #926: Use record_url for path to public page on admin interface #940

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timstallmann
Copy link
Contributor

For themes/modules that override default URLs, this ensures that the "View Public Page" link on the admin interface goes to the correct URL for an item on that particular site, rather than forcing /items/show/<id>

@zerocrates
Copy link
Member

zerocrates commented Mar 17, 2021

Have you checked this without having a plugin overriding the URL? I think the admin/public problem I mentioned in your initial issue would still happen here.

@timstallmann
Copy link
Contributor Author

Have not tested it yet, but I will!

@timstallmann
Copy link
Contributor Author

@zerocrates just tested finally, and on a default install this just links to items/show/item_id, as it should.

@zerocrates
Copy link
Member

And you're sure it's not linking to the admin items/show/<id> page? I'm pretty sure that's what your change does.

@timstallmann
Copy link
Contributor Author

Nope it was the regular /items/show page. I mean, please do test it yourself too to verify, I'd be happy to work on the code further if need be.

@zerocrates
Copy link
Member

I did test it. It makes the link go to the admin item show page.

@timstallmann
Copy link
Contributor Author

Huh strange -- let me see if I can replicate that on my end

@timstallmann
Copy link
Contributor Author

Apologies, I was checking the detail page, not the edit page; you're totally right. Do you have any suggestions about how to dynamically get the correct public item page URL here, in a way that would allow sites to use urls other than /items/show/ for the public item page? I'm not totally clear I understand the bit where the base URL for the front controller gets prepended to the result of record_url.

@zerocrates
Copy link
Member

I alluded to this problem in your original issue #926: links that go from one "side" to the other need special handling. For links created from strings, we have public_url and admin_url functions that force the URL to be created on the correct side.

I think the answer here involves creating new public_record_url and admin_record_url functions and using the public one here. If you look at public_url and admin_url you'll see that the process involved is pretty simple.

@timstallmann
Copy link
Contributor Author

Got it, thanks! Will submit a revised PR next time I can squeeze in some time..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants