Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
When I activate WPML on the website, the pagination on the blog section does't work anymore, it leads to a 404 (no error in log). Using SiteOrigin Page Builder.

Solution:
We’re working on a fix for this issue. In the meantime, you can use the following workaround:

1- Go to wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php

2- Find

$html             = '<a href="' . $url . '">removeit</a>';
        $alp_broken_links = array();
        remove_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
        $html = $absolute_links_object->_process_generic_text( $html, $alp_broken_links );
        add_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
        $url = str_replace( array( '<a href="', '">removeit</a>' ), array( '', '' ), $html );

3- Replace it with

$html             = '<a href="' . $url . '">removeit</a>';
        $alp_broken_links = array();
                $trace = debug_backtrace( FALSE, 5 );
        if (! $trace[4]["class"] == "SiteOrigin_Panels_Sidebars_Emulator" && ! $trace[4]["function"] == "register_widgets") {
            remove_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
        };
        $html = $absolute_links_object->_process_generic_text( $html, $alp_broken_links );
        add_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
        $url = str_replace( array( '<a href="', '">removeit</a>' ), array( '', '' ), $html );

Relevant Documentation:
https://wpml.org/errata/page-builder-by-siteorigin-pagination-does-not-work-in-the-blog-page/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 7.74 hours from now. Thank you for your understanding.

This topic contains 5 replies, has 2 voices.

Last updated by Dražen Duvnjak 1 month, 1 week ago.

Assigned support staff: Dražen Duvnjak.

Author Posts
September 16, 2020 at 2:12 pm

Matthias

Hello,
When I activate WPML on the website, the pagination on the blog section does't work anymore, it leads to a 404 (no error in log).
The page has french as base language and we have added english recently.
When I set hide english, then pagination seems to be working again.
I am using the current WP version with the current WPML version.

September 16, 2020 at 3:56 pm
September 16, 2020 at 4:28 pm #7029867

Matthias

Hello,
I have now cloned the site: hidden link
Same credentials for the WP backend.

September 17, 2020 at 12:22 pm #7036565

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for sharing info.

I have checked your issue and it seems the issue is caused when Page Builder by SiteOrigin is active together with the WPML plugin.

When the Page builder plugin is disabled, pagination works fine.

Video: hidden link

I was able to reproduce this issue on a clean new install and confirm this is a compatibility bug.

This issue is now escalated to our compatibility team and they will be checking and investigating it further.

I will update you when I have some news.

Thanks and kind regards,
Drazen

September 18, 2020 at 6:03 am #7042685

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

our developers checked the issue and will be providing a permanent fix in one of the future versions of WPML.

In the meantime we are providing a workaround for this issue:

Go to wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php and change:

$html             = '<a href="' . $url . '">removeit</a>';
		$alp_broken_links = array();
		remove_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
		$html = $absolute_links_object->_process_generic_text( $html, $alp_broken_links );
		add_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
		$url = str_replace( array( '<a href="', '">removeit</a>' ), array( '', '' ), $html );

WITH

$html             = '<a href="' . $url . '">removeit</a>';
		$alp_broken_links = array();
                $trace = debug_backtrace( FALSE, 5 );
		if (! $trace[4]["class"] == "SiteOrigin_Panels_Sidebars_Emulator" && ! $trace[4]["function"] == "register_widgets") {
			remove_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
		};
		$html = $absolute_links_object->_process_generic_text( $html, $alp_broken_links );
		add_filter( 'url_to_postid', array( $this, 'url_to_postid' ) );
		$url = str_replace( array( '<a href="', '">removeit</a>' ), array( '', '' ), $html );

Please let me know how it goes.

I will update you when I have some updates on this matter.

Thanks and regards,
Drazen

September 18, 2020 at 1:47 pm #7046309

Matthias

Hi Dražen,
It looks like the problem ist solved with your modification. I have done the change on the dev site. I guess this fix will be included in some future update of WPML?..
Best regards.. and thank you :-),
Matthias

September 18, 2020 at 2:04 pm #7046461

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for confirming.

Yes, the fix will be included in one of the next versions of WPML.

Kind regards,
Drazen