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.
For usability, the domain path fields should only be visible for domains that are selected as being "Published to" in the domain access options section.
Comment | File | Size | Author |
---|---|---|---|
#10 | domain_path-update_exisiting_records-1425292-10.patch | 6.16 KB | grndlvl |
#9 | domain_path-show_hide-1567502-9.patch | 4.46 KB | grndlvl |
#7 | domain_path-show_hide-1567502-5.patch | 4.44 KB | grndlvl |
#4 | domain_path-show_hide_clean-1567502-4.patch | 2.88 KB | grndlvl |
#3 | domain_path-1567502-3.patch | 3.19 KB | Les Lim |
Comments
Comment #1
crashtest_ CreditAttribution: crashtest_ commentedHere is a patch that accomplishes this by hiding or showing the path fields depending upon the corresponding access options. Also, if the "Publish to all" option is selected, they all show, and if not, then it defaults to the checkboxes under access.
Comment #2
agentrickardThe patch failed to apply against the latest dev branch.
Shouldn't we be using #attached here?
Base functionality looks fine. Need to test for a user with limited permissions.
Comment #3
Les LimUpdated CrashTest's approach to work against the latest dev and to use #attached, and reworked the js a little for simplicity.
I've tested it on a user with limited permissions, but only with patches already applied from #1337500: Restrict user to only set path on assigned domains and #1425292: domain_path_node_insert() should update existing records rather than deleting/recreating them.
Comment #4
grndlvl CreditAttribution: grndlvl commentedPatch re-roll. Applies cleanly to 7.x-1.x.
Tested limited access content creation.
Added: an over encapsulating hide on first run, to account for domains not listed in the "Publish to:" checkboxes.
(Don't think this will be needed once #1337500: Restrict user to only set path on assigned domains
&& #1425292: domain_path_node_insert() should update existing records rather than deleting/recreating them are applied.)
All seems to work.
Comment #5
agentrickardIs any of this testable? I suspect not.
Comment #6
agentrickardThis approach does not work as expected when the user has the limited permissions "Publish content only from assigned domain " or "Publish content only from the default domain". In both cases, the domain form element is suppressed, so the JS never fires.
We should address that. I suspect by setting a preselected JS variable in this case. e.g. in this code:
Comment #7
grndlvl CreditAttribution: grndlvl commentedNow when the user does not have access to the domain field then a domain id js variable is created and the js will display that path field when set. Otherwise, it will look at the domain field.
Also cleaned up the js implementation and remove "$default_domain = domain_default();" which wasn't being used anywhere.
Comment #8
grndlvl CreditAttribution: grndlvl commentedComment #9
grndlvl CreditAttribution: grndlvl commentedMinor grammatical corrections.
Comment #10
grndlvl CreditAttribution: grndlvl commentedIgnore this patch its for #1425292: domain_path_node_insert() should update existing records rather than deleting/recreating them use #9 instead.
Comment #11
agentrickardSeems to work, except an editor with limited domain permissions can still wipe all domain-specific paths for a node.
Do we need a separate permission for that?
Comment #12
grndlvl CreditAttribution: grndlvl commentedCommited http://drupal.org/commitlog/commit/17364/35a7f0af5d06ab606ae8f8788f86af1...
Thanks all!
Also I have created a new ticket for the suggestion from #11 #1675896: Delete domain-specific aliases should not be visible by restricted permissions so lets continue discussion there.
Comment #13
jca CreditAttribution: jca commentedIf in 'admin/structure/domain/settings' we have selected the option 'Select list' this patch doesn't work (the edit form does not show any textbox for aliases).
Only works for 'Checkboxes' option.
Comment #14
oldspot CreditAttribution: oldspot at Zoocha commented@jca - there is a patch for that here: https://www.drupal.org/node/2173291
It checks whether you are using select list or checkboxes.