Skip to content

Commit

Permalink
Merge pull request #32 from JorisDebonnet/patch-1
Browse files Browse the repository at this point in the history
Fix incompatibility with Translatable
  • Loading branch information
micmania1 committed Mar 14, 2016
2 parents aa2e671 + c05bbd7 commit b0841d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/forms/gridfield/GridFieldSiteTreeAddNewButton.php
Expand Up @@ -120,6 +120,12 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat
"PageType" => $tmpData['pageType']
);

// If Translatable is active, set the Locale (this will no longer be needed after a post-2.1.1
// Translatable patch; see https://github.com/silverstripe/silverstripe-lumberjack/pull/32 for more info)
if(singleton('SiteTree')->hasExtension('Translatable')) {
$data['Locale'] = Translatable::get_current_locale();
}

$controller = Injector::inst()->create("CMSPageAddController");

$form = $controller->AddForm();
Expand Down

0 comments on commit b0841d5

Please sign in to comment.