not-only-code / qtranslate-slug

Adds support for permalink translations and fix some Qtranslate deficiencies since wordpress 3.0
http://wordpress.org/extend/plugins/qtranslate-slug
46 stars 31 forks source link

Bugfix to make it work correctly on pages (probably an ugly one) #125

Closed mnsilva closed 8 years ago

mnsilva commented 8 years ago

I had to remove "name" key from the hash to allow WordPress to fetch the correct/expected post; it returned 404's otherwise.

LC43 commented 8 years ago

Hi @mnsilva, thank you so much for your contribution! do you mind explaining what was happening?

mnsilva commented 8 years ago

Hello @LC43, translated slugs on pages were not working (always getting a 404 page) so I went to figure out what was happening and found out that qtranslate-slug was getting the correct page object. Then I tested accessing with WordPress' default slug and it worked so I dumped the differences between them and caught the "name" key filled with the slug for qtranslate-slug; I deleted it and it worked.

Probably WordPress or some other plugin (I was just helping a friend, I didn't went too deeply to figure out what was really happening) do use "name" key for other purposes and the value set was not appropriate.

Best regards, Manuel