hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Entry links will not be "translated"

Open sfsmfc opened this issue 1 year ago • 9 comments

Describe the bug

If I use an entry link and copy my link field from one language/page to another and the link target is in the language, then I would expect the link to go to the page in the correct language. However, it is currently the case that the link is 1:1 the same as in the source language. The field is marked as ‘translatable’.

Steps to reproduce

  1. Create an entry with a link field in matrix container.
  2. "translate" entry into new site.

Craft CMS version

4.11.x

Plugin version

1.x

Multi-site?

Yes

Additional context

No response

sfsmfc avatar Sep 24 '24 14:09 sfsmfc

Can you clarify what you mean by "copy my link field from one language/page to another" - how are you copying the link field?

Hyper should swap out the site-specific entry that you pick for a link.

So, say you're on Site A of an entry, and you pick "About Site A" as an entry for that link, and save. If you switch to the Site B entry, the Hyper link is going to match "About Site B" (in this example, the entry we're linking to has a translated title for clarity).

Let me know if you're seeing something else.

engram-design avatar Sep 25 '24 01:09 engram-design

Hello @engram-design,

I have e.g. two sites EN and DE with a home page and an "about us" site. I create the content for the about us site in the EN page with a link to the home page. Now, the site is ready to transfer/translate to DE. I enable the site over the Craft backend and Craft copy the content from EN to DE. But the link at the DE about us site has the home page from EN as target. I would aspect, that the link has the home page to DE as target. The same result is, if a use the Site-Copy-X plugin for syncing the content from EN to DE.

sfsmfc avatar Sep 25 '24 08:09 sfsmfc

Ah, I see. It's when you're enabling a site, or at least enabling the site for the section. I'll see what I can do about that.

engram-design avatar Sep 25 '24 09:09 engram-design

I ran across a similar issue (reported by a client using our DeepL plugin).

Where we have a section with forms that get linked in Hyper fields and when doing "Add site" for an entry the hyper field keeps the relation to the original form from the first - where "regular" entries fields will swap over the the selected entry - in the new site.

janhenckens avatar Oct 09 '24 15:10 janhenckens

I've just been testing this by comparing an Entries and Hyper-entry field together, and I'm not sure I follow the expected behaviour. If I have 2 sites enabled, create an entry and populate both the Entries and Hyper field with a entry from Site A, if I switch to Site B for that entry, I see the Entries and Hyper field are now relating to the site-specific version of the entry I picked.

When adding a new site, then enabling it in the section's settings, I switch to the Site C entry, and the Entries and Hyper field are showing the Site A entry linked to.

engram-design avatar Oct 10 '24 00:10 engram-design

Actually, scratch that - I didn't notice I wasn't testing correctly.

Fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-4 as 1.3.2".

engram-design avatar Oct 10 '24 00:10 engram-design

Hey Josh

I updated to the dev-craft-4 version but I'm still seeing this behaviour.

  • Create an new entry in site A
  • Link another entry from site A in a hyper field on that entry
  • Run "Add site" on that entry so it also exists in site B
  • The hyper field on the entry in site B still refers to the entry in site A
  • The entry I'm linking to exists in both

janhenckens avatar Oct 10 '24 06:10 janhenckens

Ah, I was checking if this was during a resave process (when a new site is added), but great point that some sections allow entries to be opted-into now, and new site-specific entries are created.

Fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-4 as 1.3.2".

engram-design avatar Oct 11 '24 10:10 engram-design

Thanks @engram-design, installed the latest fix and can confirm that works for us :) Appreciate the good follow up!

janhenckens avatar Oct 11 '24 10:10 janhenckens

are there any updates on this issue? (: i got a similar problem, but with craft 5. The Hyper Field on my site is not inside a matrix field, but multiple Links is enabled on the hyper field.

remoflury avatar Nov 13 '24 13:11 remoflury

Should already be fixed in 1.3.3 and 2.1.2, but feel free to open a new issue if you encounter a problem.

engram-design avatar Nov 14 '24 22:11 engram-design