Skip to content

Commit 4afbc4e

Browse files
FIX Don't try to save blocks in a readonly elemental area (#1292)
1 parent 6d0fb1e commit 4afbc4e

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

client/dist/js/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/legacy/ElementEditor/entwine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jQuery.entwine('ss', ($) => {
101101

102102
'from .cms-edit-form': {
103103
onbeforesubmitform(event, data) {
104-
if (!data) {
104+
if (!data || this.is('.elemental-area--read-only')) {
105105
return;
106106
}
107107
// Create a promise and expose the resolve function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@javascript @retry @job6
2+
Feature: Restore to draft
3+
As a CMS author
4+
I want to restore archived pages with elemental areas to draft version
5+
6+
Background:
7+
Given I add an extension "DNADesign\Elemental\Extensions\ElementalPageExtension" to the "Page" class
8+
And a "page" "MyPage"
9+
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Archive' section"
10+
And I am logged in as a member of "EDITOR" group
11+
And I go to "/admin/pages"
12+
And I should see "MyPage"
13+
And I click on "MyPage" in the tree
14+
And I press the "Publish" button
15+
16+
Scenario: I can restore archived elemental block to draft version
17+
When I press the "Add block" button
18+
Then I click on the ".font-icon-block-content" element
19+
Then I should see "Untitled Content block" in the ".element-editor__element" element
20+
And I click on the ".element-editor__element" element
21+
And I fill in "Form_ElementForm_1_Title" with "MyBlock"
22+
When I press the "View actions" button
23+
And I press the "Publish" button
24+
And I wait 1 second
25+
And I click "More options" in the "#ActionMenus" element
26+
And I press the "Unpublish and archive" button, confirming the dialog
27+
And I go to "/admin/archive"
28+
Then I should see "MyPage" in the "#Form_EditForm" element
29+
Then I click "MyPage" in the "#Form_EditForm" element
30+
When I press the "Restore to draft" button
31+
Then I should see "Successfully restored the page" in the "#Form_EditForm" element
32+
And I go to "/admin/pages"
33+
And I click on "MyPage" in the tree
34+
Then I should see "MyBlock" in the ".element-editor__element" element

0 commit comments

Comments
 (0)