Hopefully this is the final change, I have noticed that URLs containing percentage encoded characters are getting double encoded.
The final solution isn't that clean, but not sure much else can be done.
I have spotted another issue with the above parsing method. URLs that contain multiple query strings will have & instead of &.
Accoring to https://www.drupal.org/project/entity_embed/issues/2973178 → this is correct.
This causes parse_url not to work correctly, so I have added decoding and re-encoding the url to work around this.
Sorry I made a small mistake in the last patch, This is correct now
The attached patch fixes the query string issue mentioned in #8 and also handles a url fragment should it exist.
I've spotted an issue with the above fix, I've opened a separate issue here
https://www.drupal.org/project/tmgmt/issues/3370882
🐛
Paragraphs translations aren't always updated
Fixed
Basically the above is calling $target_entity->needsSave();
which is a getter rather than a setter, I believe it should be calling $target_entity->setNeedsSave(TRUE);
paulmartin84 → created an issue.