mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: FileIFrameField throws sub-URLs error when changing cms to a non default language (#4767)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97984 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2294d0986b
commit
cce52a59d2
@ -55,12 +55,19 @@ class FileIFrameField extends FileField {
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/ui.core.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/ui.dialog.js');
|
||||
|
||||
|
||||
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
|
||||
$record = $this->form->getRecord();
|
||||
if(Object::has_extension('SiteTree', 'Translatable') && $record->Locale){
|
||||
$iframe = "iframe?locale=".$record->Locale;
|
||||
}else{
|
||||
$iframe = "iframe";
|
||||
}
|
||||
return $this->createTag (
|
||||
'iframe',
|
||||
array (
|
||||
'name' => $this->Name() . '_iframe',
|
||||
'src' => Controller::join_links($this->Link(), 'iframe'),
|
||||
'src' => Controller::join_links($this->Link(), $iframe),
|
||||
'style' => 'height: 152px; width: 100%; border: none;'
|
||||
)
|
||||
) . $this->createTag (
|
||||
|
Loading…
Reference in New Issue
Block a user