Skip Navigation

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.

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by Carlos Rojas 2 years, 6 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
January 17, 2018 at 6:32 pm #1487739

Tommaso

Russian urls associated with custom post type, with the corresponding translated slug, are not correctly encoded.

Example:
- Default Language (IT): hidden link
- Russian Language (RU):
[if I click on language switcher]
hidden link
[if I pass over the language switcher link]
hidden link
[url from var_dump(icl_get_languages())]
hidden link
[the correct russian link]
hidden link
[or]
hidden link

All my DB tables are utf8_general_ci.
Any explanation?

January 21, 2018 at 9:31 pm #1491285

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting WPML support.

1.- Please follow this steps in order to isolate the cause of the issue:
- Make a full backup of the site before making any change, for security reasons.
- Update all outdated plugins, theme and core if corresponds.
- Flush all cache memory.
- Deactivate all plugins except WPML plugins.
- Activate a default WordPress theme like Twenty Seventeen.
- If the issue disappeared start activating the theme and then the plugins one by one until you see the issue again.

Please let me know the result of this steps.

2.- Please upgrade the PHP version to meet WordPress minimum requirements: https://wordpress.org/about/requirements/

Kind regards,
Carlos

January 22, 2018 at 3:07 pm #1492197

Tommaso

Hello Carlos

1. Please follow this steps in order to isolate the cause of the issue:
- Make a full backup of the site before making any change, for security reasons.

Done

- Update all outdated plugins, theme and core if corresponds.
The plugins were already updated to the latest version

- Flush all cache memory.
I have already tried this before requesting assistance

- Deactivate all plugins except WPML plugins.
Tested. The problem persists.

- Activate a default WordPress theme like Twenty Seventeen.
Tested. The problem persists.

- If the issue disappeared start activating the theme and then the plugins one by one until you see the issue again.
The problem persists.

Please let me know the result of this steps.

2.- Please upgrade the PHP version to meet WordPress minimum requirements: https://wordpress.org/about/requirements/

I can't upgrade PHP to version 5.6 or 7.2. As indicated in the wpml control panel the site has the minimum characteristics to work properly: https://wpml.org/home/minimum-requirements/

PHP
Versione 5.5.38
Limite di memoria 1024m
Utilizzo della memoria 35.43 MB
Durata max di esecuzione 0
Variabili di input max 12000
Utf8mb4 charset Sì
Estensione per stringhe multibyte Caricato
Estensione SimpleXML Caricato

WordPress
Versione 4.9.2
Funzionalità Multisite No
Limite di memoria 256M
Limite di memoria max 256M

January 22, 2018 at 7:17 pm #1492679

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

1.- Thank you very much for this information. I recommended you to upgrade the PHP version to meet WordPress minimum requirements, not WPML minimum requirements. WPML works with PHP v5.3 and above, however there are many plugins that doesn't and WordPress recommend to use PHP v7.2 or greater. This was the reason of my recommendation.

2.- Could you tell me how this custom post type is created? Was this custom post type created by you or by a plugin?

3.- Did you re-save the permalink structure after this custom post type was created/added? If you didn't, please do it and check if the issue persist.

Looking forward to your answer.
Kind regards,
Carlos

January 22, 2018 at 7:49 pm #1492718

Tommaso

1. Yes, 7.2 is the most up-to-date version, but not all hosting providers still have the possibility to activate it. Soon I hope to update at least the version at 5.6 anyway.

2. The custom post type was manually created by me. Here is the code.

add_action('init', 'custom_post_room_page_register');
function custom_post_room_page_register() {
	  
	$labels = array(
		'name'               => _x( 'Camere', 'post type general name' ),
		'singular_name'      => _x( 'Camera', 'post type singular name' ),
		'menu_name'          => _x( 'Camere', 'admin menu' ),
		'name_admin_bar'     => _x( 'Camera', 'add new on admin bar' ),
		'add_new'            => __( 'Aggiungi nuova' ),
		'add_new_item'       => __( 'Aggiungi nuova camera' ),
		'new_item'           => __( 'Nuova camera' ),
		'edit_item'          => __( 'Modifica camera' ),
		'view_item'          => __( 'Visualizza camera' ),
		'all_items'          => __( 'Tutte le camere' ),
		'search_items'       => __( 'Cerca camera' ),
		'parent_item_colon'  => __( 'Camera genitore:' ),
		'not_found'          => __( 'Nessuna camera trovata.' ),
		'not_found_in_trash' => __( 'Nessuna camera trovata nel cestino.' )
	);
 
	$args = array(
		'labels'             	=> $labels,
		'description' 			=> 'Gestione delle Camere.',
		'public'             	=> true,
		'exclude_from_search'	=> false,
		'publicly_queryable' 	=> true,
		'show_ui'            	=> true,
		'show_in_menu'       	=> true,
		'show_in_nav_menus' 	=> true,
		'menu_position'      	=> null,
		'menu_icon' 			=> '',
		'capability_type'    	=> 'post',
		'hierarchical'       	=> false,
		'supports'          	=> array( 'title', 'editor', 'thumbnail' ),
		'has_archive'        	=> false,
		'rewrite'            	=> array( 'slug' => 'camera' ),
		'query_var'         	=> true,
		'can_export'         	=> true
	); 
 
	register_post_type('room', $args);

}

3. I went to the permalink management page and I saved. The problem persists.

---

The problem is only present in Russian and I think it's a problem of coding some characters, but only in the url because the characters are correctly seen in the content. On pages where this problem is present, going to the admin panel of the page, the permalink part is not visible (see the screenshot).

January 22, 2018 at 8:11 pm #1492745

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

Please follow this steps:
- Go to WPML -> Translation Management -> Multilingual Content Setup tab -> Custom Posts section -> Change the slug in russian for the camera CPT (please just use latin letters, ex: camera-ru) -> Save
- Go to Settings -> Permalinks -> Re-save the permalink structure.

Does the issue persist?

Kind regads,
Carlos

January 22, 2018 at 8:34 pm #1492778

Tommaso

Yes works.

hidden link

January 22, 2018 at 8:42 pm #1492787

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

This issue seems to be caused by a strange character in your russian slug. Could you use another slug for the russian language?

Regards,
Carlos

January 22, 2018 at 8:52 pm #1492799

Tommaso

The word is "номера" but the problem also occurs with other custom post type with other words in Russian. I would like to understand the cause to solve the problem, since once the page was correctly displayed (the error was also present in the version prior to 3.9, so I also made the update, hoping it would be resolved).

The page slug (last part of the url) is displayed correctly. Could it be a wpml function linked to the slug of the custom post type that doesn't correctly interpret Cyrillic characters?

January 22, 2018 at 8:57 pm #1492806

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I will try to reproduce this issue on a fresh install on a local environment and I'm going to consult my colleagues about this issue.

I will get back to you as soon as I have an answer.

Thank you for your patience.
Regards,
Carlos

January 23, 2018 at 12:46 pm #1493781

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Please follow this steps:
- Make a full backup of the site for security reasons.
- Go to WPML -> Languages -> Site Languages section -> Edit Languages link -> Select row Russian -> Column 'Encode URLs' -> Select 'Yes' -> Save the changes.
- Set the original 'номера' slug for Russian.

Does the issue disappeared?

Regards,
Carlos

January 23, 2018 at 2:52 pm #1494016

Tommaso

Hi,

- Go to WPML -> Languages -> Site Languages section -> Edit Languages link -> Select row Russian -> Column 'Encode URLs' -> Select 'Yes' -> Save the changes.
Done

- Set the original 'номера' slug for Russian.
Done

I have also updated the permalinks and emptied the WPML cache

Does the issue disappeared?
No. I did all the steps now, but I had done the same procedure even before requesting assistance and it had not worked as now.

January 23, 2018 at 5:06 pm #1494267

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

I have consulted this issue with one of my colleagues that speaks russian. These are the steps recommended:
- Remove the translation of the slug from String Translation.
- Set 'номера' as slug for the Custom Post Type in WPML -> Translation Management -> Multilingual Content Setup -> Post types

Note: Maybe one of the characters used originally for the slug wasn't from the cyrilian alphabet.

Please let me know if the issue persist after this steps.
Kind regards,
Carlos