Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

More thant 10 results in Relationship Metabox #245

Open
asadowski10 opened this issue Dec 12, 2016 · 15 comments
Open

More thant 10 results in Relationship Metabox #245

asadowski10 opened this issue Dec 12, 2016 · 15 comments

Comments

@asadowski10
Copy link

Hi team,

We use your plugin for one of our clients ( http://www.dassault-aviation.com/ ) and we have a linking problem in the Relationship Metabox.

More explanations :

I have one page with title "Falcon" on site 1 and we have an other page with the same title "Falcon" on site 2.
When I want to create the link between the two pages using "Select Existing post...", the desired page does not go up in AJAX Response ...

In this case, how can i link the two pages ? Is it possible to you, to add a load more results ?

edit page dassault aviation wordpress

Thanks a lot !

Version Information

  • WordPress: 4.4.5
  • MultilingualPress: 2.4.8
@tfrommen
Copy link
Member

tfrommen commented Dec 16, 2016

Hi there!

The logic behind the AJAX search is a simple get_posts() call with the s argument, triggering a search.

The only explanation I have for a post that matches your search query (even more: in its title!) not showing up is that the post has already been connected to some other post on the site you are currently on.

Can you verify on site 2 that the Falcon post is not yet connected to any post (on site 1)?

Maybe (if something really is off here) you might want to check directly in your database. To do so, try the following SQL query (that you have to adapt to your table prefix and site as well as post IDs, of course):

SELECT
    *
FROM
    wp_multilingual_linked
WHERE
    ml_type = 'post' AND ml_source_blogid != ml_blogid
    AND (
        (
            ml_source_blogid = 2 AND ml_source_elementid = 42
        ) OR (
            ml_blogid = 2 AND ml_elementid = 42
        )
    )

Just change the site ID (2 in the above code) and the post ID (42) to what your Falcon post is, and paste the result here, if any.

Best regards,
Thorsten

By the way: any particular reason you are using WordPress 4.4.5? :)

@tfrommen tfrommen self-assigned this Dec 16, 2016
@tfrommen
Copy link
Member

Hi @asadowski10,

any news here? Did you investigate this any further?

I will close this sometime soon, unless there is still any problem here...

@tfrommen tfrommen closed this as completed Feb 6, 2017
@asadowski10
Copy link
Author

Hi @tfrommen,

I'm back ! Sorry for the response time.
I just made some new tests with real URL.

I have 2 contents but the linking doesn't work.

http://www.dassault-aviation.com/fr/passion/espace-decouverte/realite-augmentee/visuels-dassaultair3d/ blog_id 1 and post_id 42996
http://www.dassault-aviation.com/en/passion/discovery/augmented-reality/dassaultair3d-images/ blog_id 2 and post_id 43949

SELECT * FROM wp_multilingual_linked WHERE ml_type = 'post' AND ml_source_blogid != ml_blogid AND ( ( ml_source_blogid = 2 AND ml_source_elementid = 43949 ) OR ( ml_blogid = 2 AND ml_elementid = 43949 ) )

The SQL response is : ml_id : 6085 | ml_source_blogid : 43602 | ml_blogid : 2 | ml_elementid : 43949 | ml_type : post

ID : 43602 is a draf post on blog_id 1 the French Website.

I deleted the relationship from the back office between the draft post 43602 and post_id 43949 ( en ) then I redone my new relationship but that's the same problem :(

Can you help me solve the problem?

Best ,
Alex

NB : We are currently migrating to the 4.7.2 ;)

@tfrommen
Copy link
Member

tfrommen commented Feb 16, 2017

Hi,

so, to sum that up, the post you wanted to select actually had a relationship - which is why it didn't show up in the list. You then deleted the relationship (i.e., the according entry in the wp_multilingual_linked table). After that you ... could or could not select that post from the other site?

Cheers,
Thorsten

@tfrommen tfrommen reopened this Feb 16, 2017
@asadowski10
Copy link
Author

Hi @tfrommen,

Even when the content already has a relationship, it goes back up in the list and the relationship is not done with the right content.

In fact, i have 2 problems :

  • The AJAX response that does not go up the right content.
  • The relationship is not the done with the right content.

Best,
Alex

@asadowski10
Copy link
Author

Hey @tfrommen,
I hope you are well ?

Do you have some news about my problems ?

Thanks a lot !
Alex

@tfrommen
Copy link
Member

tfrommen commented Mar 3, 2017

Hi there!

Content that is already related should not be displayed in the (AJAX search) results. If this is the case then something is pretty broken (in your installation). Can you check (in your dev tools) if this really is the case by looking at the value of the radio input? It contains the post ID. Maybe you just have (for whatever reason) a duplicate with the same name (but different IDs)?

I also have a few questions:

  • Can you reproduce this on another install?
  • Can you provide me with a DB dump?
  • Is there some testing/staging environment where you could give me access to?
  • Any information you can add?

Thanks in advance,
Thorsten

@asadowski10
Copy link
Author

Hi @tfrommen !

If you want, to go faster, I can provide you by mail FTP / back office / phpmyadmin access on our dev env ?
What is your mail ?

Thanks a lot !

@tfrommen
Copy link
Member

tfrommen commented Mar 9, 2017

Hi,

that might speed up things quite a bit, yes.
You can send any credentials to [email protected].

Thanks in advance,
Thorsten

@asadowski10
Copy link
Author

Hi @tfrommen
Credentials sent !

Thanks !

@asadowski10
Copy link
Author

Hi @tfrommen
Did you receive my email ?
Best,

@tfrommen
Copy link
Member

tfrommen commented Mar 31, 2017

Hi @asadowski10,

well, the problem is that you have an ... let's call it unusual way of naming posts. 😛
You have 30 pages with "Falcon" in the title, and the page you are looking for (with the exact title "Falcon") ranks as 28th search result.

A post with a title that is exactly like your search phrase should rank higher than a page with the search phrase only being part of its title. But for some reason this is not the case. No idea if you have plugins running that modify the query (e.g., by hooking into pre_get_posts), or if there's something wrong in WordPress core...

Anyway, I'm afraid the only thing you can do now is to set up relations for posts not displaying in the search results manually in the DB. Sorry.

For a future version of MultilingualPress, we will include some sort of pagination or "show more" functionality.

Cheers,
Thorsten

@asadowski10
Copy link
Author

Hi @tfrommen

Thanks a lot for your answer ! We look forward to this future development.

Best,
Alex

@tfrommen tfrommen added this to the v3.0.0 milestone Apr 21, 2017
@tyrann0us
Copy link
Member

tyrann0us commented May 30, 2017

Workaround: Change numberposts to -1 in inc/relationship-control/Mlp_Relationship_Control_Data.php#102 until there will be a official solution.

@gmazzap gmazzap assigned seville76 and unassigned tfrommen May 29, 2018
@Dinamiko Dinamiko modified the milestones: v3.0.0, v2.11.2 Aug 27, 2018
@Hube2
Copy link

Hube2 commented Sep 5, 2018

I was just having a similar issue and found this. My first thought on starting to read this and seeing the results on the site I am working on is that the number of posts is being limited . Setting this to -1 could cause issues with an extremely large site, like the one that I'm dealing with. Perhaps a paged approach to allow getting more results.

@widoz widoz assigned widoz and unassigned seville76 Oct 8, 2018
@Dinamiko Dinamiko modified the milestones: v2.11.2, v2.11.3 Nov 21, 2018
@widoz widoz removed their assignment Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants