Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Don't try to save blocks in a readonly elemental area #1292

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/src/legacy/ElementEditor/entwine.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jQuery.entwine('ss', ($) => {

'from .cms-edit-form': {
onbeforesubmitform(event, data) {
if (!data) {
if (!data || this.is('.elemental-area--read-only')) {
return;
}
// Create a promise and expose the resolve function
Expand Down
34 changes: 34 additions & 0 deletions tests/Behat/features/restore-archived-page.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@javascript @retry @job6
Feature: Restore to draft
As a CMS author
I want to restore archived pages with elemental areas to draft version

Background:
Given I add an extension "DNADesign\Elemental\Extensions\ElementalPageExtension" to the "Page" class
And a "page" "MyPage"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Archive' section"
And I am logged in as a member of "EDITOR" group
And I go to "/admin/pages"
And I should see "MyPage"
And I click on "MyPage" in the tree
And I press the "Publish" button

Scenario: I can restore archived elemental block to draft version
When I press the "Add block" button
Then I click on the ".font-icon-block-content" element
Then I should see "Untitled Content block" in the ".element-editor__element" element
And I click on the ".element-editor__element" element
And I fill in "Form_ElementForm_1_Title" with "MyBlock"
When I press the "View actions" button
And I press the "Publish" button
And I wait 1 second
And I click "More options" in the "#ActionMenus" element
And I press the "Unpublish and archive" button, confirming the dialog
And I go to "/admin/archive"
Then I should see "MyPage" in the "#Form_EditForm" element
Then I click "MyPage" in the "#Form_EditForm" element
When I press the "Restore to draft" button
Then I should see "Successfully restored the page" in the "#Form_EditForm" element
And I go to "/admin/pages"
And I click on "MyPage" in the tree
Then I should see "MyBlock" in the ".element-editor__element" element
Loading