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

Unexpected relation created and not removed after disconnecting #273

Closed
moorscode opened this Issue Jul 31, 2017 · 5 comments

Comments

3 participants
@moorscode

moorscode commented Jul 31, 2017

When implementing our HREF-Lang implementation some unexpected results occurred on a page which was linked but the link was removed.
x-default and language entries are added, but there are no alternatives, so they should not be presented.

It seems that a relation-to-self is being added whenever a relation is created.
This relation-to-self is never removed.

Version Information

  • PHP: any
  • WordPress: 4.8
  • MultilingualPress: 2.7

Steps to Reproduce

  1. Create a relation
  2. Remove the relation
  3. Check the multilingual_linked table for an entry from the source page and blog to itself

What I Expected

When no relations exist, no entries to be found in the table.

What Happened Instead

An entry always remains after once creating a relation on an object.

@tfrommen

This comment has been minimized.

Show comment
Hide comment
@tfrommen

tfrommen Jul 31, 2017

Contributor

Hey there,

while I understand that the entry is not needed anymore, and it has been fixed for the v3 release already, what exactly is the problem with this? You should not be checking the database (results) directly, but use the API, for example the mlp_get_linked_elements() function.

Can you show me (an outline of) what you are doing exactly, so I better understand the direct implications?

Thanks,
Thorsten

Contributor

tfrommen commented Jul 31, 2017

Hey there,

while I understand that the entry is not needed anymore, and it has been fixed for the v3 release already, what exactly is the problem with this? You should not be checking the database (results) directly, but use the API, for example the mlp_get_linked_elements() function.

Can you show me (an outline of) what you are doing exactly, so I better understand the direct implications?

Thanks,
Thorsten

@diedexx

This comment has been minimized.

Show comment
Hide comment
@diedexx

diedexx Jul 31, 2017

Contributor

Hey,

We noticed that, after removing the link between two posts, the hreflang link of (only) the original post was still present. (When debugging this, we took a look in the database directly.)
We expect that the self-reference is also removed when there are no linked posts remaining, so the hreflang links aren't shown when there aren't any translations (anymore).

Contributor

diedexx commented Jul 31, 2017

Hey,

We noticed that, after removing the link between two posts, the hreflang link of (only) the original post was still present. (When debugging this, we took a look in the database directly.)
We expect that the self-reference is also removed when there are no linked posts remaining, so the hreflang links aren't shown when there aren't any translations (anymore).

@tfrommen

This comment has been minimized.

Show comment
Hide comment
@tfrommen

tfrommen Jul 31, 2017

Contributor

Can you please check if the new branch, issue/273_orphan_content_relations, already works for you?

Thanks.

Contributor

tfrommen commented Jul 31, 2017

Can you please check if the new branch, issue/273_orphan_content_relations, already works for you?

Thanks.

@diedexx

This comment has been minimized.

Show comment
Hide comment
@diedexx

diedexx Jul 31, 2017

Contributor

That works! 👍

Contributor

diedexx commented Jul 31, 2017

That works! 👍

tfrommen added a commit that referenced this issue Jul 31, 2017

tfrommen added a commit that referenced this issue Jul 31, 2017

@tfrommen tfrommen self-assigned this Jul 31, 2017

@tfrommen

This comment has been minimized.

Show comment
Hide comment
@tfrommen

tfrommen Jul 31, 2017

Contributor

Fixed in df4eac9.

Contributor

tfrommen commented Jul 31, 2017

Fixed in df4eac9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment