multilingual-press icon indicating copy to clipboard operation
multilingual-press copied to clipboard

More thant 10 results in Relationship Metabox

Open asadowski10 opened this issue 7 years ago • 15 comments

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

asadowski10 avatar Dec 12 '16 12:12 asadowski10

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 avatar Dec 16 '16 18:12 tfrommen

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 avatar Jan 31 '17 06:01 tfrommen

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 ;)

asadowski10 avatar Feb 16 '17 14:02 asadowski10

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 avatar Feb 16 '17 17:02 tfrommen

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 avatar Feb 17 '17 17:02 asadowski10

Hey @tfrommen, I hope you are well ?

Do you have some news about my problems ?

Thanks a lot ! Alex

asadowski10 avatar Mar 02 '17 08:03 asadowski10

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

tfrommen avatar Mar 03 '17 07:03 tfrommen

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 !

asadowski10 avatar Mar 07 '17 14:03 asadowski10

Hi,

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

Thanks in advance, Thorsten

tfrommen avatar Mar 09 '17 19:03 tfrommen

Hi @tfrommen Credentials sent !

Thanks !

asadowski10 avatar Mar 24 '17 08:03 asadowski10

Hi @tfrommen Did you receive my email ? Best,

asadowski10 avatar Mar 30 '17 09:03 asadowski10

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

tfrommen avatar Mar 31 '17 06:03 tfrommen

Hi @tfrommen

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

Best, Alex

asadowski10 avatar Apr 21 '17 07:04 asadowski10

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

tyrann0us avatar May 30 '17 12:05 tyrann0us

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.

Hube2 avatar Sep 05 '18 17:09 Hube2