Commit f6073aa2 authored by Stephen Shkardoon's avatar Stephen Shkardoon

3.1 allowed_actions and Config fixes

parent d216ec6c
......@@ -148,12 +148,16 @@ class NewsletterEmail extends Email {
}
if($static_base_url = self::get_static_base_url()) {
$orig_baseURL = Director::baseURL();
Director::setBaseURL($static_base_url);
$base_url_changed = true;
$base_url = Config::inst()->get('Director', 'alternate_base_url');
Config::inst()->update('Director', 'alternate_base_url', $static_base_url);
} else {
$base_url_changed = false;
}
$link = Director::absoluteBaseURL() . "unsubscribe/index/".$this->recipient->ValidateHash."/$listIDs";
if(isset($orig_baseURL)) {
Director::setBaseURL($orig_baseURL);
if ($base_url_changed) {
// remove our alternative base URL
Config::inst()->update('Director', 'alternate_base_url', $base_url);
}
return $link;
......@@ -187,4 +191,4 @@ class NewsletterEmail extends Email {
public function getData() {
return $this->templateData();
}
}
\ No newline at end of file
}
......@@ -11,6 +11,10 @@ class NewsletterGridFieldDetailForm extends GridFieldDetailForm {
}
class NewsletterGridFieldDetailForm_ItemRequest extends GridFieldDetailForm_ItemRequest {
private static $allowed_actions = array(
'ItemEditForm',
'emailpreview',
);
public function updateCMSActions($actions) {
if (empty($this->record->Status) || $this->record->Status == "Draft") {
......@@ -235,4 +239,4 @@ class NewsletterGridFieldDetailForm_ItemRequest extends GridFieldDetailForm_Item
public function preview($data){
return $this->record->render();
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment