mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1023 from tractorcow/pulls/3.1/mink-update
BUG Fix deleted pages redirecting the CMS
This commit is contained in:
commit
601efbc088
@ -120,12 +120,6 @@ class ContentController extends Controller {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
if(!$this->dataRecord->canViewStage(Versioned::current_archived_date() ? 'Stage' : Versioned::current_stage())) {
|
if(!$this->dataRecord->canViewStage(Versioned::current_archived_date() ? 'Stage' : Versioned::current_stage())) {
|
||||||
$link = $this->Link();
|
|
||||||
$message = _t(
|
|
||||||
"ContentController.DRAFT_SITE_ACCESS_RESTRICTION",
|
|
||||||
'You must log in with your CMS password in order to view the draft or archived content. ' .
|
|
||||||
'<a href="%s">Click here to go back to the published site.</a>'
|
|
||||||
);
|
|
||||||
Session::clear('currentStage');
|
Session::clear('currentStage');
|
||||||
Session::clear('archiveDate');
|
Session::clear('archiveDate');
|
||||||
|
|
||||||
|
@ -1397,7 +1397,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$tags .= $this->ExtraMeta . "\n";
|
$tags .= $this->ExtraMeta . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Permission::check('CMS_ACCESS_CMSMain') && in_array('CMSPreviewable', class_implements($this)) && !$this instanceof ErrorPage) {
|
if(Permission::check('CMS_ACCESS_CMSMain')
|
||||||
|
&& in_array('CMSPreviewable', class_implements($this))
|
||||||
|
&& !$this instanceof ErrorPage
|
||||||
|
&& $this->ID > 0
|
||||||
|
) {
|
||||||
$tags .= "<meta name=\"x-page-id\" content=\"{$this->ID}\" />\n";
|
$tags .= "<meta name=\"x-page-id\" content=\"{$this->ID}\" />\n";
|
||||||
$tags .= "<meta name=\"x-cms-edit-link\" content=\"" . $this->CMSEditLink() . "\" />\n";
|
$tags .= "<meta name=\"x-cms-edit-link\" content=\"" . $this->CMSEditLink() . "\" />\n";
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I select "awesome" in the "Content" HTML field
|
And I select "awesome" in the "Content" HTML field
|
||||||
When I press the "Insert Link" button
|
When I press the "Insert Link" button
|
||||||
When I select the "Anchor on this page" radio button
|
When I select the "Anchor on this page" radio button
|
||||||
# Need to hard-code the id attribute of the <select> here, as there are two form fields to pick from
|
And I fill in "myanchor" for "Anchor"
|
||||||
And I select "myanchor" from "Form_EditorToolbarLinkForm_AnchorSelector"
|
|
||||||
And I press the "Insert link" button
|
And I press the "Insert link" button
|
||||||
Then the "Content" HTML field should contain "<a href="#myanchor">awesome</a>"
|
Then the "Content" HTML field should contain "<a href="#myanchor">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
|
@ -71,7 +71,7 @@ Feature: Manage files
|
|||||||
Scenario: I can filter the files list view using filetype
|
Scenario: I can filter the files list view using filetype
|
||||||
Given a "file" "assets/document.pdf"
|
Given a "file" "assets/document.pdf"
|
||||||
And I expand the "Filter" CMS Panel
|
And I expand the "Filter" CMS Panel
|
||||||
And I select "Image" from "File type"
|
And I select "Image" from "File type" with javascript
|
||||||
And I press the "Apply Filter" button
|
And I press the "Apply Filter" button
|
||||||
Then the "Files" table should contain "file1"
|
Then the "Files" table should contain "file1"
|
||||||
And the "Files" table should not contain "document"
|
And the "Files" table should not contain "document"
|
||||||
|
@ -30,7 +30,7 @@ Scenario: I can limit global view permissions to logged-in users
|
|||||||
|
|
||||||
Scenario: I can limit global view permissions to certain groups
|
Scenario: I can limit global view permissions to certain groups
|
||||||
Given I select "Only these people (choose from list)" from "Who can view pages on this site?" input group
|
Given I select "Only these people (choose from list)" from "Who can view pages on this site?" input group
|
||||||
And I select "AUTHOR group" from "Viewer Groups"
|
And I select "AUTHOR group" from "Viewer Groups" with javascript
|
||||||
And I press the "Save" button
|
And I press the "Save" button
|
||||||
When I am not logged in
|
When I am not logged in
|
||||||
And I go to the homepage
|
And I go to the homepage
|
||||||
@ -51,7 +51,7 @@ Scenario: I can limit global edit permissions to logged-in users
|
|||||||
|
|
||||||
Scenario: I can limit global edit permissions to certain groups
|
Scenario: I can limit global edit permissions to certain groups
|
||||||
Given I select "Only these people (choose from list)" from "Who can edit pages on this site?" input group
|
Given I select "Only these people (choose from list)" from "Who can edit pages on this site?" input group
|
||||||
And I select "ADMIN group" from "Viewer Groups"
|
And I select "ADMIN group" from "Editor Groups" with javascript
|
||||||
And I press the "Save" button
|
And I press the "Save" button
|
||||||
Then pages should not be editable by "AUTHOR"
|
Then pages should not be editable by "AUTHOR"
|
||||||
But pages should be editable by "ADMIN"
|
But pages should be editable by "ADMIN"
|
||||||
|
@ -61,7 +61,7 @@ So that only high quality changes are seen by our visitors
|
|||||||
Given I am logged in with "ADMIN" permissions
|
Given I am logged in with "ADMIN" permissions
|
||||||
And I go to "/admin/pages"
|
And I go to "/admin/pages"
|
||||||
And I should see "Hello" in the tree
|
And I should see "Hello" in the tree
|
||||||
And I follow "Hello"
|
And I click on "Hello" in the tree
|
||||||
|
|
||||||
When I click "More options" in the "#ActionMenus" element
|
When I click "More options" in the "#ActionMenus" element
|
||||||
And I press the "Unpublish" button
|
And I press the "Unpublish" button
|
||||||
@ -75,7 +75,7 @@ So that only high quality changes are seen by our visitors
|
|||||||
Given I am logged in with "ADMIN" permissions
|
Given I am logged in with "ADMIN" permissions
|
||||||
And I go to "/admin/pages"
|
And I go to "/admin/pages"
|
||||||
And I should see "My Page" in the tree
|
And I should see "My Page" in the tree
|
||||||
When I follow "My Page"
|
And I click on "My Page" in the tree
|
||||||
And I press the "Publish" button
|
And I press the "Publish" button
|
||||||
And I click "More options" in the "#ActionMenus" element
|
And I click "More options" in the "#ActionMenus" element
|
||||||
Then I should see "Unpublish" in the "#ActionMenus_MoreOptions" element
|
Then I should see "Unpublish" in the "#ActionMenus_MoreOptions" element
|
||||||
|
Loading…
Reference in New Issue
Block a user