Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After dragging a block to another section, we see the message:
* The changes to these blocks will not be saved until the Save blocks button is clicked.
Suppose a user forgot to click the 'Save blocks' button but clicks on the 'Configure' link, the new region settings are discarded.
I would like to auto-save the new settings on a drag release event.
Comment | File | Size | Author |
---|---|---|---|
#2 | draggable.zip | 55.97 KB | BarisW |
Comments
Comment #1
XanoSubscribing.
Comment #2
BarisW CreditAttribution: BarisW commentedSo far I made some big steps! The auto-save is working, however it could use some improvements.
Please let me know what you think so far. Would anyone be so kind to patch these files for me? I have not done this before.
Comment #3
BarisW CreditAttribution: BarisW commentedComment #4
XanoComment #5
Bojhan CreditAttribution: Bojhan commentedMarking critical, I can't do that sadly - hope someone else picks up.
Comment #6
tic2000 CreditAttribution: tic2000 commentedThe changes in block.js delete also the code that stops a user from moving a block to a not allowed region. That should be put back.
The changes in tabledrag.js should add the case when there is an error in saving the changes too. On line 807 there is a new empty line that should be removed.
Comment #7
XanoI figured out a way to submit practically every form using JS which we can use for these UIs that supports returning form errors. I'll post a patch tomorrow.
Comment #8
BarisW CreditAttribution: BarisW commentedHi tic2000,
when is a block not allowed in a specific region?
I discovered some problems with current solution:
Maybe it's better if we disable dropping on not-allowed regions (by greying out regions)?
Comment #9
catchBaris - the regions are allowed, just not for certain blocks, so they can't be greyed out across the board. This is to stop you from making your site unusable by disabling the 'system content' block (which actually contains the block admin screen, and all other admin screens).
Comment #10
catchWhile I'm a bit concerned about saving people's mistakes without a corresponding undo button, I think I like this.
I've been working on a site with a lot of blocks recently (probably about 30-50), and the most irritating bit of working on that site is enabling a block by putting it into a region, saving it. Scrolling back up to find the block again, then clicking configure to get block visibility rules. You can get 'round it by opening configure in a new firefox tab but it's easy to forget.
This would (probably) also fix another annoyance - open the configure link in a tab to delete a custom block, delete it, then try dragging another block and saving the form - you'll get a validation error because it tries to save the 'missing' block which is still in the form.
Comment #11
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is nowhere critical.
I have some doubt about this from a UX perspective. What do the UX gods think?
Comment #12
yched CreditAttribution: yched commentedAlso, I think 'auto save' feature has been considered and rejected when drag-n-drop was being worked on in D6, so at least we'd need to reevaluate the reasons given back then.
Comment #13
Bojhan CreditAttribution: Bojhan commentedFrom the 11 users we observed in our last usability test, about 6 initially forgot to save blocks. But corrected it fairly fast, so if 50% of our users fail. I think its pretty critical.
I think its an quick fix, to a big issue -hence why it should be critical.
Comment #14
Damien Tournoud CreditAttribution: Damien Tournoud commentedI defer to the UX gods.
Comment #15
Xano@Bojhan: It's a quick fix in that it won't be a 100KB patch, but if we want to fix this properly, we'd probably need to expand the current AHAH feature set (Communication between JS and the server for forms) and that will take some time to figure out. I expect I will have at least a preliminary patch this evening.
Comment #16
Bojhan CreditAttribution: Bojhan commentedSure, I never imply easyness of code :)
Comment #17
catchSo the situation where this most concerns me is places like book administration, taxonomy drag and drop, menu links where you have lots of items, it's easy to drag stuff into the wrong tree, then want to refresh/back out of that page to start again. If we have autosave, then just trying stuff out can leave you with a massive job to fix your changes.
We'll need some feedback on the page to say it's been autosaved, I'm wondering if we can keep very basic revisions in the form cache to provide an undo button - just for changes made while on the page.
Comment #18
tic2000 CreditAttribution: tic2000 commented@Baris
When the main content was converted to a block it was a discussion and they decided to use an alert and move the block back where it came from so that is the desired behavior.
The fact that now a block will always be added as first it's a bug and I marked your issue as a duplicate. The bug is known and there is even a patch for it, but got forgotten here #477018: Reordering blocks doesn't work as it should
Comment #19
Bojhan CreditAttribution: Bojhan commentedcatch: I think we need to evaluate that on a page by page basis, or as you said initiate a pattern. I don't see for the scope of this issue, that we should map it to those cases already.
Comment #20
Bojhan CreditAttribution: Bojhan commentedLet's get some work done on this.
Comment #21
catchBojhan, afaik this issue tries to implement it for every draggable form across the board - so if we have a blanket autosave for those forms, we need to make sure we don't make things worse.
Comment #22
Bojhan CreditAttribution: Bojhan commentedI don't feel we should, it only makes the scope of this issue larger. Instead a generic pattren, then an issue for blocks, then see where else it applies. Because it doesn't always apply.
Comment #23
BarisW CreditAttribution: BarisW commented@catch The select-options still work. So in case of long lists, you can always select the right group from the drop-down. I developed this solution because of a long-time frustration.
Old situation:
- Drag a block to a region
- Scroll down
- Click Save Blocks
- Scroll up
- Find the block
- Click configure
New situation:
- Drag a block to a region
- Click configure
I agree, an Undo button would be preferable, but not necassary. Maybe users should have to get used to the new behaviour. My opinion is that this will help unexperiences users as well as oldtimers like us.
Comment #24
catchBaris - there's no select list on menu, term or book administration - it's those pages that concern me. Like Bojhan said we should probably just leave them out of the patch.
Comment #25
kkaefer CreditAttribution: kkaefer commentedI don’t think auto-saving this form is a good idea for several reasons:
Instead of auto-saving, we could prompt the user when he leaves the form with unsaved changes. Safari is doing that for most other forms, but not for the block settings form.
Comment #26
Bojhan CreditAttribution: Bojhan commentedOhh gosh :(. I really didn't want to turn this into a discussion, because that could drag on for a long while. Anyway, yes its an exception and it won't confuse users if we give good feedback. Even if it is the odd one in the crowd, with good feedback I don't feel it would confuse them too much - but obviously we need to apply this all over the board.
Why would someone destroy the block configuration? I don't see how its much more destroying then a save button. Its not like you go to the block page, to play with blocks.
We could do the model when unsaved changes, but it seems like a compromise.
Comment #27
kkaefer CreditAttribution: kkaefer commentedWhy are you thinking that it won't confuse users?
If the changes are saved instantly it's impossible to "revert" to the previous state by canceling changes. It happened to me occasionally that the dragging script went nuts and placed blocks in regions I didn't want (maybe because the browser scrolled up or down automatically). IMHO, reordering (not configuring) blocks is a very explicit operation that should be confirmed; it's not something you do every day.
Comment #28
BarisW CreditAttribution: BarisW commentedHi guys,
just to make sure: my idea was to implement this on every type of draggable form. By doing so, this wouldn't make it an 'odd one in the crowd', but making it work for all draggable forms. I agree that it would be preferable to have an Undo button, to revert to the previous version AFTER an auto-save. By doing so, we will enhance the system by adding a better User Experience, but also give give users the option to roll-back their changes in case of a misconfiguration.
I'm unassigning this due to lack of time. If anyone wants to jump in, feel free to do so!
Comment #29
Bojhan CreditAttribution: Bojhan commented@kkaefer Because I feel when we give the feedback of yellow to fading to blue it will make sense. It shouldn't trigger before the mouse is released. Looking at the usability tests we ran, almost every single individual forgot to save - which makes this a very critical issue, just giving a confirmation will just trigger more use of an bad pattren.
Of course there are times when this isn't going to work, ie when your browser scrolls up. But it won't save until you release, so I don't see it being such a very big problem. There are times when undo could be useful, I do not disagree with that - but making the barrier to change lower, should also mean that people won't mind just fixing their mistake.
As I said, this could easily turn into a discussion about explicitly asking them to confirm stuff. But as I am trying to point out, that's a bad software pattren - 80% of the people make changes, and they want these changes. Only a very small percentage makes a mistake and wants to undo it all.
Comment #30
Noyz CreditAttribution: Noyz commentedsubscribing
Comment #31
swentel CreditAttribution: swentel commentedI'm with kkaefer on that one. However, autosave can be interesting, but it would be interesting if it would be possible to turn of that feature.
Comment #32
kkaefer CreditAttribution: kkaefer commentedThis could be implemented independent from the tabledrag.js. We should write a generic "autosave form" script so that we can say that a certain form autosaves. The tabledrag.js script would then just invoke the form autosave and the "autosave form" script takes care of the rest (e.g. disabling the submit button while saving or obtaining new form tokens or determining changes between the current form and the newly rendered form after a save).
Comment #33
drewish CreditAttribution: drewish commentedsubscribing...
Comment #34
RobLoachSubscribing.
Comment #35
babbage CreditAttribution: babbage commentedI am of the opinion that an undo feature should be a required part of making this particular solution—autosave—an acceptable change.
In fact, the problem being solved is people leaving forms without saving changes. Autosave is not the only solution. If the key problem is people wanting to configure blocks immediately having moved them to a new region, the configure link could trigger a confirmation whether the user wanted to confirm unsaved changes, before moving on to the configuration page. That would ensure users get the behaviour they expect (they have made the change to the blocks and they haven't lost it) without the significant regression that there is no way to undo a mistake—not even by refreshing the page.
Don't get me wrong—I think autosave would be fabulous. I just think it would be fundamentally flawed without a "Revert" (to previous configuration) button.
Comment #36
babbage CreditAttribution: babbage commentedHere's something else to think about—if you have block changes autosaving, then if someone is working on a live site (it happens) the blocks will be moving live on the site one-by-one as they are making changes, rather than a user being able to create an entire new configuration and then save it. That would likely not be desirable for all users.
Comment #37
babbage CreditAttribution: babbage commentedYou know, the simplest possible solution to this problem would be to just add to the configure links:
target="_blank"
That way, every configure link would open in a new window and you'd never throw away your new block setup.
In fact, this is such a common-sense and quick patch that I'm going to post an issue for that now. In the event that a more sophisticated solution is implemented, it can go by the wayside. But in the meantime, we can at least have that guaranteed to be in D7.
ETA: #515530: Prevent loss of user's changes when clicking configuration links in Block admin page
Comment #38
Bojhan CreditAttribution: Bojhan commentedSadly this doesnt seem possible before January 15th, would love to reopen this for Drupal 8.
Comment #39
catchDowngrading all D8 criticals to major per http://drupal.org/node/45111
Comment #40
jantimon CreditAttribution: jantimon commentedWhen reworking this plz consider also to implement http://drupal.org/node/1268530.
I guess those two issues home some points in common.
Comment #41
yoroy CreditAttribution: yoroy commentedSubscribe
Comment #42
yched CreditAttribution: yched commentedBig fat -1 from me. Reordering stuff usually takes several steps, which can take a couple seconds / minutes to get right : place this row here, that other row there, hide that other one, *then* apply all atomically. We cannot force users to only take intermediate steps that have to correspond to a "valid" state you'd want to see live. If any single row drag gets applied instantly, I would get scared each time I have to reorder stuff on a live site.
+ a draggable row has other components apart from the d-n-d handle (take Field UI's "Manage display" : each row has selects for label display and formatter, plus formatter settings in an ajax subform), which are *not* autosaved (and that we wouldn't want to autosave), so having just the reordering be autosaved would get fairly confusing.
Autosave was explicitly left out for those very reasons when d-n-d landed in d6, and those reasons have not changed since then. I do not really see how we could suddenly decide we discard them. If usability tests show there is a misunderstanding around this, then UX enhancements should focus on how we make the behavior clearer, not on changing it, because IMO we can't.
Comment #43
Everett Zufelt CreditAttribution: Everett Zufelt commentedAlong with agreeing 100% with yched in #42...
I question how this might cause problems for accessibility, haven't thought it through so tagging.
Comment #44
Everett Zufelt CreditAttribution: Everett Zufelt commentedSee somewhat related: #1272990: Make tabledrag warning message show when row weights are enabled, and add WAI-ARIA live region
Comment #45
nod_Closed #376107: Ajax support / Auto-save support for tabledrag.js, and from #42 it sounds like this one just need to be marked "won't fix"?
Comment #46
geerlingguy CreditAttribution: geerlingguy commentedI agree with a "won't fix" here, but maybe at least showing a warning when navigating away from a page with unsaved row changes would solve the core UX issue while not creating others?
Comment #47
michaelfavia CreditAttribution: michaelfavia commentedAs much as i hate the "table drag shuffle" of move save configure i agree with yched here as well as it relates to "invalid intermediary steps" especially as it relates to other uses of draggable tables (field ordination, etc).
Marking wontifx as that seems to be the consensus but i agree that our current UI/UX is broken for most new users because everyone i train always forgets to save first and has to redo their work.
+1 for the "you edited without saving modal" or even autosaving the form locally (object cache) and repopulating your changes with the option to revert at the top like views does.
Comment #48
babbage CreditAttribution: babbage commentedAgree with won't fix for this suggestion. Am still keen to progress #515530: Prevent loss of user's changes when clicking configuration links in Block admin page if it has any support.
Comment #49
nod_See #1644090: [Meta] form data loss
Comment #50
falcon03 CreditAttribution: falcon03 commentedNothing to review here, so removing tag.
Comment #51
falcon03 CreditAttribution: falcon03 commentedfixing tags.