Closed (fixed)
Project:
Content locking (anti-concurrent editing)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2017 at 11:37 UTC
Updated:
10 Nov 2017 at 07:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hchonovComment #4
hchonovOups. The patch should apply now.
Comment #5
chr.fritschIn general i like the idea. Could we improve the settings form usability a bit. I think it's confusing if you are able to check "All bundles" and additionally specific bundles. So i think we should hide all other bundles if "All bundles" is selected.
This is not the autosaveForm module ;-)
Comment #6
kfritscheFixed the "typo" and hide the bundles if all is selected.
Comment #7
kfritscheAgain a small fix, when first time loading the settings form. In this case the bundles were not hidden.
Comment #8
kfritscheFixed options are not reseted between entities on settings form. This resulted in the last entity having all bundles of all entities ;)
Also fixed missing entities which doesn't have a bundle. You still can select all now in this case.
Comment #9
hchonovThe patch looks much better now. Thank you, @kfritsche. I just have a couple of remarks.
According to the jQuery documentation disabled and checked are properties and should therefore be modified through the jQuery method "prop". Let's also add the drupal class "is-disabled" when disabling an element and also remove it when activating an element.
Adding this condition leaves only the "*" option in case of entities not supporting bundles, but it might happen that it is planned that entity supports bundles at some point and the user wants to activate the content lock only for the default entity bundle, but having only the "*" option she could not limit the lock only on the default bundle. Does this use case make sense?
"...on which TO enable..."
Comment #10
kfritscheThanks for the review, fixed 1+2
I think exactly for this case its good that all bundles are locked. As the user always expected this behavior and when adding new bundle she might forget about content_lock setting, resulting in content not locked anymore, which worked before. In my mind this is correct. Most use-cases for content lock in my mind are anyways entity based and not bundle based.
I would leave it like this.
Comment #11
hchonovWell, I guess this makes sense :).
All the remarks of @chr.fritsch and me have been fixed and the change is pretty straightforward, therefore I think it should be safe to get this in. Thank you!
Comment #12
chr.fritsch#2911532: Lock on entity translation level instead on entity level landed, so this needs a reroll.
Comment #13
kfritscheRe-roll party :)
Comment #14
chr.fritschYou introduced all entity types to the settings page. Currently content_lock doesn't work with entity types without bundles. So we have to remove them.
Comment #15
kfritsche@chr.fritsch it should work now with all entity types, as for entities without bundles you have the all selection now.
This makes it usable for entity_types without bundles. Also the used function ->bundle() always returns something. For entity_types without bundles this is the entity_type.
This was true for the case before, but with this patch is possible now.
Comment #16
chr.fritschI activated it for the user entity type and went to user edit page. Then i got a 500.
Comment #17
kfritscheBug confirmed. Thanks for testing and finding it.
Its now fixed.
In BreakLockRoutes I still checked for $definition->getBundleEntityType(), this is removed now and tested with the use case above.
Comment #18
chr.fritschOk, the bug from #16 is now fixed. The bundle hiding on the settings page still doesn't work if you click 'All bundles'.
Comment #19
kfritscheFor all entity_types or only for entity_types without bundles?
Only way I can reproduce it, after a drush cr and firefox browser cache clean, if I click on it before the JS is loaded. Just because my system is to slow after I cleaned all caches. On second request everything loads to fast to reproduce it.
Comment #20
chr.fritschI was first testing this in Thunder. In a clean Drupal installation it works. So seems that we broke something in Thunder.
Comment #22
chr.fritschThank you, guys :-)