FIX 63366327 breaking "Existing Translations" links

CMSEditLink() was changed to always add a locale, but the link
creation for "Existing Translations" in Translatable#updateCMSFields
assumed there was no query string on the end of CMSEditLink()s return
value

Note that youll still end up with duplicate locale parameters after
this patch, but it will work as PHP always takes the last parameter
for preference. A seperate patch for Controller::join_links will
fix the duplicate parameters
This commit is contained in:
Hamish Friedlander 2013-09-20 11:21:28 +12:00
parent a0fab3b7c2
commit 3acb8b9fba

View File

@ -1075,10 +1075,9 @@ class Translatable extends DataExtension implements PermissionProvider {
if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
$existingTransHTML .= sprintf(
'<li><a href="%s">%s</a></li>',
sprintf(
'%s/?locale=%s',
$existingTranslation->CMSEditLink(),
$existingTranslation->Locale
Controller::join_links(
$existingTranslation->CMSEditLink(),
'?locale='.$existingTranslation->Locale
),
i18n::get_locale_name($existingTranslation->Locale)
);