7

I have created a custom type under Drupal 8 Admin page. but when create a new custom type content, "Save and Publish" button is missing. while, the button is shown on "Basic page" content.

I have to click on "Preview" button, then click on "back to content editing", Drupal 8 then redirect me to Edit page, and a button "Save and keep Publish" been shown.

  • 1
    I have created a fresh Drupal 8 installation, same problem, custom content type has no "Publish and Save" button, is this a Drupal 8 default setup? – anru Jan 8 '16 at 3:39
  • 1
    made a interesting discovery, under core\modules\node\src\Nodeform, inside function protected function actions(), if I hard code $element['submit']['#access'] to ture, "Save and Publish" button returned, it seems problem lies in $node->type->entity->getPreviewMode(), I will report back. – anru Jan 8 '16 at 4:24
  • Waiting for a report :) Please tag me in a comment when you do (Tagging can be done via the @ character). – JohnDoea Jan 8 '16 at 5:35
  • 1
    @benos , I have found out, this is because , I have turned on "Preview before submit" option. to turn it off, 1> Edit the content type 2> Click "Submission form settings" 3> Set "Preview before submitting" to Optional – anru Jan 8 '16 at 6:29
  • Oh btw anru, if you are a JS programmer can you please try to help me here? Any help will be good, drupal.stackexchange.com/questions/186102/… – JohnDoea Jan 8 '16 at 6:59
13

Ok, post an answer here.

This is because I did turned on "Preview before submit" option.

to turn it off, 1> Edit the content type 2> Click "Submission form settings" 3> Set "Preview before submitting" to Optional.

But I just find a problem/bug , when you turn on "Preview before submit". I am unable to update/modify my content, it always redirect me to "Preview" page.

here is how to reproduce it.

1> turn on "Preview before Submitting" option
2> create a content, at first, you can save the content.
3> then try to modify / edit that content again,you will find out 
    you are unable to save the content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.