Zum Inhalt springen Zur Seitenleiste springen

Dieses Thema ist gelöst. Hier finden Sie eine Beschreibung des Problems und der Lösung.

Problem:
When accessing a URL with UTM parameters on a site using the WPML and the Avada Theme, only a blank page is displayed.
Solution:
The issue was identified within the Event Calendar plugin. To resolve it, follow these steps:
1. Access the site's filesystem using FTP or your hosting file manager.
2. Navigate to

/wp-content/plugins/the-events-calendar/src/Tribe/

.
3. Open the

Query.php

file and locate line 577.
4. Replace the existing code with the following:

protected static function add_post_type_to_query(WP_Query $query, string ...$post_types): void {<br />    $query_post_types = self::get_query_post_types($query);<br />    if (class_exists('Sitepress')) {<br />        $is_root_enabled = apply_filters('wpml_sub_setting', false, 'urls', 'directory_for_default_language');<br />        if ($is_root_enabled && is_home()) {<br />            return;<br />        }<br />    }<br />    $updated_post_types = array_unique(array_merge($post_types, $query_post_types));<br />    $query->set('post_type', $updated_post_types);<br />    $query->query['post_type'] = $updated_post_types;<br />}

5. Save the changes and test the URL with UTM parameters again.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we recommend opening a new support ticket. Additionally, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML Support Forum.

Dies ist das technische Support-Forum für WPML – das mehrsprachige WordPress-Plugin.

Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team antwortet im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.

Schlagwörter: 

Dieses Thema enthält 10, hat 2 Stimmen.

Zuletzt aktualisiert von Prosenjit Barman Vor 1 Jahr, 9 Monaten.

Assistiert von: Prosenjit Barman.

Autor Beiträge
Mai 27, 2024 um 13:46 #15674566

twentyZen

The root page functions completely normally. But as soon as I call the url with utm parameters, only a blank page is displayed. Is this a known WPML issue? Or a known conflict with the Avada Theme?

Please try:
versteckter Link
and
versteckter Link

Mai 28, 2024 um 7:53 #15676627

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're experiencing. I checked the root page and found that it returns a 404 error when any parameter is added to the URL, not just UTM parameters.

Could you please check if the issue persists when the WPML plugin is disabled? Keeping the plugin disabled, add any parameter to the URL after the main domain and see if the problem still occurs.

If so, it could be an issue with rewrite rules. Please resave the permalink structure by going to "Settings > Permalinks" and check again. You can also check by updating the htaccess of your site with the default rules mentioned here: https://developer.wordpress.org/advanced-administration/server/web-server/httpd/#basic-wp

Let me know how it goes. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

Mai 29, 2024 um 7:55 #15681971

twentyZen

Hello Prosenjit,

thank you for your answer.

The page cannot be found with parameters in the url, that's right. The problem also only occurs when WPML is activated.

I think the problem is that the root page does not "physically" exist in WordPress, but can only be accessed via WPML (see picture below). So the question remains, why does the URL work without parameters, while the page with parameters cannot be found?

Best regards

rootwpml.png
Mai 30, 2024 um 5:28 #15685818

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

The root page does exist, but it is kept hidden. If you go to "WPML > Languages" and click on the "Edit root page" link, the root page will load with a unique ID in the URL bar. This indicates that it is available in the database but hidden in the pages section. It is possible that the query parameters are not configured to work on the root page, which is why the page returns a 404 error.

For further investigation, I kindly request you to try replicating the issue on our sandbox site. The autologin URL to our sandbox is provided below.

- versteckter Link

The WPML and its addons are already installed in the sandbox. Please complete the setup, and if any additional plugins are required to replicate the issue, install them as well.

Once the plugins are set up, configure the sandbox to match the settings on your main site and try to recreate the issue.

If you're able to do so, please let me know. I will take a closer look and assist you accordingly.

Please let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

Mai 30, 2024 um 12:12 #15687853

twentyZen

Hi,

i tried to replicate in your Sandbox. Seems Avada and Plugins are not the problem. I will double check the htaccess. Thanks and best regards

Mai 31, 2024 um 4:35 #15690494

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hello There,

Thank you for the update. Please check and if you need further assistance, feel free to reach out. We will be happy to help.

Best regards,
Prosenjit

Juni 10, 2024 um 12:53 #15722092

twentyZen

Hi again,
I found out which plugin is causing the error, it is the Events Calendar Plugin, I just hadn't considered it until now because events should have nothing to do with the root page...

There are some reported bugs regarding wpml and events calendar, but I could not find the reference to the root page. Do you have more insights?

Best regards

Juni 11, 2024 um 5:12 #15724421

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

I have checked our system and found no reports regarding issues with the Root page when using the Events Calendar plugin. To determine if the issue is specific to your site or a widespread problem, could you please try replicating it on our sandbox? Since the previous sandbox I shared has expired, I am including the link to a new sandbox site below.

- versteckter Link

The WPML and its addons are already installed in the sandbox. Please complete the setup. Once done, install the Events Calendar plugin, configure both WPML and the Events Calendar as you have on your site, and check if you can reproduce the issue.

If the issue is successfully recreated, please let me know. I will then take a look and escalate the issue to our 2nd tier team for further investigation if required.

Looking forward to your response and appreciate your cooperation in this matter.

Best regards,
Prosenjit

Juni 13, 2024 um 8:41 #15734898

twentyZen

Hi,
i now found the cause: in events calendar settings the option "Integrate events in main blog loop" leads to this error. I deactivated it now.
Can WPML do something to resolve this conflict?
Best regards

Juni 13, 2024 um 13:10 #15736362

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well!

Thank you for replicating the issue in the sandbox and sharing the details about what caused it. This is incredibly helpful!

I have escalated this matter to our second-tier team for further investigation. As soon as I have an update from them, I will inform you.

Once again, thank you so much for your effort and kind cooperation in this matter.

Best regards,
Prosenjit

Juni 25, 2024 um 11:32 #15819950

Prosenjit Barman
WPML-Unterstützer seit 03/2023

Sprachen: Englisch (English )

Zeitzone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well.

Our dev team has investigated the issue and found a workaround. The problem was primarily caused by a function within the code of the Event Calendar plugin. Please follow the steps below to solve the issue:

1. Using FTP or your hosting file manager, access the filesystem of your site.
2. Navigate to `/wp-content/plugins/the-events-calendar/src/Tribe/`.
3. Open the `Query.php` file.
4. Replace the following code on line 577 :

protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
		
		$query_post_types = self::get_query_post_types( $query );

		$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );

		$query->set( 'post_type', $updated_post_types );
		$query->query['post_type'] = $updated_post_types;
	}

with the following code:

protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
		
		$query_post_types = self::get_query_post_types( $query );

		// WPML Workaround for compsupp-7426
		if ( class_exists('Sitepress') ) {
			$is_root_enabled = apply_filters( 'wpml_sub_setting', false, 'urls', 'directory_for_default_language' );
			
			if ( $is_root_enabled && is_home() ) {
				return;
			}
		}

		$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );

		$query->set( 'post_type', $updated_post_types );
		$query->query['post_type'] = $updated_post_types;
	}

- Save the changes and try to access the Root page by adding a parameter in the URL.

I tested it on the sandbox and the solution worked perfectly.

Please give it a try and let me know how it goes. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit