Closed (fixed)
Project:
Drupal core
Version:
8.0.0-beta1
Component:
node system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Oct 2014 at 20:56 UTC
Updated:
29 Dec 2014 at 18:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirComment #2
vj commentedI have made some change and its working now for drupal 8.x.
Can someone please test and confirm its working properly
Comment #3
charlesjc commentedComment #4
damien tournoud commentedComment #5
berdirI have no idea what the field_storage there exactly means?
I suspect we simply no longer need this condition, as preview now works differently? I'm actually not sure how this is exactly supposed to work now that preview is on a separate page. To keep this, we somehow need to set a flag when we preview the first time?
Will also need tests.
Comment #6
mimran commentedjust apply the patch as #2 it works like a charm
Comment #7
swentel commentedHmm yeah, we'll probably need to store a flag in form state and set this to true once the preview has ben seen. We can default it to TRUE and make that conditional way easier then I guess, that get field_storage check looks weird indeed.
Comment #8
rvolkShouldn't we have a flag "preview_required" which should be set to false once the preview has been seen?
A second thought should be, if the flag resets to true once the content is edited again after preview - to fulfill the original intention of the content-type administrator: "Only publish previewed content". As long the content differs from the preview state a publishing option should not be available.
Comment #9
berdirThis setting is from before the preview system was changed to be on a separate patch.
The DX now is IMHO pretty confusing now, as it works like this: Add => fill out => preview => edit => save. So you need to go back to edit to be able to save.
For this to make sense, it seems that we should have a Save button next to "Edit again", then this would be very easy to solve, we would simply never show save on the edit form, just on preview.
If that is not possible, I'm wondering if we should remove this feature from core instead?
Comment #10
yoroy commentedWhat berdir says makes sense: if I must preview before I can save, then let me save directly from the preview. I guess before dropping a core feature we must at least ensure that contrib could make it work again.
Comment #11
swentel commentedThere is an issue to try implement the save functionality on the preview screen itself, see #1899360: Add save dropbutton next to 'Back to content editing' link in node preview. - which is open for discussion of course :)
Comment #12
swentel commentedSo I was confused as well with the check on ->get('field_storage'). So I think we should look for a different approach. Attached patch introduces a hasBeenPreviewed property which is set to TRUE after coming from preview. Has tests as well.
We can look for adding a save button in the other issue, because that is a little more tricky to get right.
Comment #14
jibranThanks this makes a lot of sense.
Comment #15
webchickCommitted and pushed to 8.0.x. Thanks!