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

Localize the parent tag #4294

Merged
merged 2 commits into from
Sep 22, 2021
Merged

Conversation

daiwai
Copy link
Contributor

@daiwai daiwai commented Sep 21, 2021

Fetch the parent data from the current site/locale.

Updated the Entry::findByUri @method signature to include the $site parameter

Also, URL::removeSiteUrl() adds a superfluous slash and should probably call URL::tidy() before returning. I did not change removeSiteUrl in this PR yet, because I wanted to confirm whether the current behavior is intentional (as far as I see, that method is not covered by a test).

Fetch the parent data from the current site/locale. Fixes statamic#2991
@jasonvarga
Copy link
Member

This is great, thanks.

I don't think it fixes the issue you've linked to, but it does fix the tag 👍

@jasonvarga jasonvarga merged commit 68b6ac9 into statamic:3.2 Sep 22, 2021
@daiwai
Copy link
Contributor Author

daiwai commented Sep 23, 2021

Thanks for the review and merging!

I don't think it fixes the issue you've linked to, but it does fix the tag

Well, I referenced the linked issue because of your #2991 (comment) there, and you changing the title of that issue to "The parent tag doesn't localize" which this PR addressed.

But you are right that this doesn't do anything related to the issue with non-localized relations not being automatically loaded in the current site locale which is also mentioned in #2991

Also, URL::removeSiteUrl() adds a superfluous slash and should probably call URL::tidy() before returning. I did not change removeSiteUrl in this PR yet, because I wanted to confirm whether the current behavior is intentional (as far as I see, that method is not covered by a test).

I see you used Str::after() instead of URL::removeSiteUrl() any thoughts on the current behavior of removeSiteUrl() though?

@jasonvarga
Copy link
Member

jasonvarga commented Sep 23, 2021

That method isn't used anywhere throughout the code base. I think it's just there for backwards compatibility at this point, in case someone else happens to be using it. I don't want to touch it.

Also, it looks like I misunderstood that issue initially, the title I changed it to is wrong.

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.

2 participants