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.

Nessun supporter è disponibile a lavorare oggi sul forum Italian. Sentitevi liberi di creare ticket e li gestiremo il prima possibile quando saremo online. Grazie per la comprensione.

This topic contains 16 risposte, has 3 voci.

Last updated by George Botsev 4 anni, 8 mesi fa.

Assigned support staff: George Botsev.

Autore Post
April 14, 2015 at 2:42 pm #599177

federicoM-2

Salve,
Ho un sito bilingue italiano e inglese. Dopo aver aggiornato a WPML String Translation 2.1.3 sul mio sito di test locale (le informazioni di debug fornite fanno riferimento al sito live, dove ho fatto il downgrade a 2.1.1) con WPML 3.1.9.5 ottengo un errore 404 visualizzando post appartenenti a Custom Post Types in italiano.

Esempio definizione CPT:

    register_post_type( 'congressi',
        array(
            'labels' => $labels,
            'public' => true,
            'show_ui' => true,
            'menu_position' => 5,
            'capability_type' => 'post',
            'has_archive' => false,
	    'rewrite' => array('slug' => _x( 'congresses', 'URL slug', 'framework' )),
            'hierarchical' => false,
            'show_in_menu' => true,
            'supports' => array( 'title', 'editor' )
        )
    );

Il problema si verifica con i CPT il cui nome registrato con $register_post_type è uguale all'URL slug tradotto in italiano.
Es: CPT "congressi" - URL Slug ENG: "congresses" - URL Slug ITA: "congressi"
ITA hidden link -> 404
ENG hidden link -> Corretto

Segnalo che il problema NON si verificava con String Translation 2.1.1.
Molto probabilmente il problema è nel file slug-translation.php nella funzione

public static function filter_pre_get_posts 

Potrei sbagliarmi ma forse dipende da:

$query->query_vars[ 'post_type' ] = $new_slug;

Se lo commento tutto torna a funzionare.

Spero possiate presto risolvere il problema.

Grazie.

April 15, 2015 at 9:03 am #599669

Vincenzo
Supporter

Languages: Inglese (English ) Italiano (Italiano )

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

Salve Federico,

grazie per aver contattato il supporto WPML.

Sto verificando sulla mia installazione test le informazioni fornite.

Non appena ho un riscontro le farò sapere.

Grazie

April 15, 2015 at 12:08 pm #599839

federicoM-2

Salve Vincenzo,
grazie, resto allora in attesa di sue notizie.
Se posso fornire qualche altro dettaglio utile:
il problema si verifica perché nella funzione

public static function filter_pre_get_posts

(della quale ancora mi sfugge l'utilità) $query->query_vars[ 'post_type' ] viene settato al valore della chiamata self::get_translated_slug( $slug, 'en' ), cioè si presuppone che il nome del CPT sia uguale allo slug inglese. Questo però non è detto, perché ad esempio nel mio caso il nome del CPT, definito con register_post_type, è "congressi". Stranamente la chiamata a self::get_translated_slug( $slug, 'en' ) nella versione inglese ritorna sempre "congressi", per cui in quel caso tutto funziona.

Spero questo possa essere utile.
Grazie,
FM

April 15, 2015 at 3:00 pm #600009

Vincenzo
Supporter

Languages: Inglese (English ) Italiano (Italiano )

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

Ho passato il ticket al supporto di secondo livello.

E' possibile che si metteranno in contatto tramite il forum.

Se lo faranno, la lingua usata sarà l'inglese.
Può confermarmi che questo non sarebbe un problema?

Grazie

April 15, 2015 at 3:14 pm #600022

federicoM-2

Salve Vincenzo,
Grazie.
I can read and write in English, it's not a problem.

April 16, 2015 at 12:28 pm #600704

George Botsev
Supporter

Languages: Inglese (English )

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

Salve Federico!
I am George from second tier support.
I have verified the issue on my local test platform and I have escalated this further to our 3rd tier and developers.
Thank you for providing a possible solution for this - our developers will take a look at this as well.

When I have more information about the issue, I will let you know.

May 8, 2015 at 7:56 am #614760

federicoM-2

Hello George,
I would like to know when the new release of String Translation, hopefully with the bug fix, will be available.
Thank you.

May 8, 2015 at 8:10 am #614773

George Botsev
Supporter

Languages: Inglese (English )

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

Hello, this issue should be resolved in the current WPML 3.2 RC 3.
However I would not recommend you to use this release in a production environment.
If you have a staging server or a test server, you can give it a try.

For your question about the release date - this depends on our developers and I have no information about this.

May 29, 2015 at 2:58 pm #628921

federicoM-2

Unfortunatelly I have to report that the problem described in this post is still in place updating to String Translation 2.1.4. I had to downgrade to 2.1.2 again. I pointed out clearly the issue, and I really cannot understand why it is still present in the new release. I am really disappointed and, frankly, very tired of wasting my time.
PLEASE fix this bug AS SOON AS POSSIBLE. If you need me to translate the post in English, I can do that.

Thank you.

June 1, 2015 at 6:19 am #629443

George Botsev
Supporter

Languages: Inglese (English )

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

Hello again.
The latest version 2.1.4 does not include this fix at all.
The fix will be part of the release of WPML 3.2 when released -with the bundled version of String Translation there.
As a workaround you can always change register_post_type( 'congressi', to something other and the translation should work again.
The other option at this time is to wait a little bit more for WPML 3.2 - where, our developers told me that this should be fixed.

June 1, 2015 at 2:15 pm #629893

federicoM-2

Hi George,
thank you for the prompt reply.
I cannot change register_post_type( 'congressi' to something else because I already have several posts which are connected to that registered name.
So, it seems that I have to wait for 3.2 release. I hope it will not take too much time.
Cheers.

June 1, 2015 at 2:55 pm #629930

George Botsev
Supporter

Languages: Inglese (English )

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

We have strong indications that it will be soon.

June 12, 2015 at 7:21 am #636851

George Botsev
Supporter

Languages: Inglese (English )

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

Hello, we just released version 3.2 of WPML.
You can see a video how to update here: hidden link

June 23, 2015 at 12:19 pm #644333

federicoM-2

Hi George, thank you for your notice. I'd like to upgrade but I'm a bit scared of the manual update procedure... can you assure me I won't lose my settings and translated strings, deleting the old version of the plugins?

June 23, 2015 at 12:25 pm #644343

George Botsev
Supporter

Languages: Inglese (English )

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

Hello again.
For your security we always recommend that you make a full database and website backup or use a staging server for that operation.
If you are using translation service from Icanlocalize - then at this time is not recommended to update.
All of the translated data should remain on the database if you perform the upgrade correctly. Our plugin will not remove anything there.
If you follow the video and the process for the update, then you should not have any issues.
If you have any issue - you can always revert from the backup that you have made previously.

The topic ‘[Closed] Dopo upgrade String Translation 2.1.3 errore 404 custom posts’ is closed to new replies.