Problem/Motivation
Machine name validation for element fires each time there's no way to disable and prevent that
Proposed resolution
Allow to set #access
or #disabled
property to control that
Remaining tasks
Find a way to access the property and document that in render element doc block
User interface changes
API changes
Original report by @niko-
Hi
Today I found that ctools export drop previous cloned copy of any type of objects.
My enveronment is fresh D7 install with last versions of ctools and panels
Steps to reproduce.
1. Create flexible layout with name XXX
2. Clone it via UI
3. Clone it (Not "clone_of_XXX" instance but original) second time and change any thing in this copy but not the machine name (row, region ...)
Layout cloned on step 3 will overwrite layout cloned on step 2
Comment | File | Size | Author |
---|---|---|---|
#11 | ams1.patch | 1.2 KB | andypost |
#8 | ams1.patch | 1.2 KB | andypost |
#3 | machine_name-missing-validation-2347171-3.patch | 804 bytes | niko- |
#2 | machine_name-missing-validation-2347171-2.patch | 611 bytes | niko- |
Comments
Comment #1
niko- CreditAttribution: niko- commentedHm
My debug shows that reason of overriding is #machine_name core validator
it looks like now
but if I do not touch machine_name but change human name, machine name will not change.
So #default_value == #value and uniq check will skip.
Same in Drupal 8 core.
Comment #2
niko- CreditAttribution: niko- commentedI checked the #machine_name form element type
https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...
and example in menu module.
As I understood, only if element disabled it must not be validate with callback specified in 'exists' elment key.
I think if user can change machine_name it must be validated
So in edit forms if this is regular edit without clone we must set
In any clone like form we set
or do not set $form['machine_name']['#disabled'] at all
patch attached
P.S.
If my hotfix is right then this is need to check core modules about this changes
Comment #3
niko- CreditAttribution: niko- commentedDrupal 8 patch
Comment #4
niko- CreditAttribution: niko- commentedComment #7
andypostComment #8
andypostThis one should be fixed in core first.
Disabled (no access) machine name could not be changed
Comment #10
andypostComment #11
andypostComment #24
larowlanDisabled elements aren't submitted by the browser - can we get some steps to reproduce this?
Comment #26
Kristen PolThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" 3 months ago with a request for steps to reproduce and there has been no activity since that time.
Since we need more information to move forward with this issue, I am keeping the status at Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #27
quietone CreditAttribution: quietone at PreviousNext commentedInformation needed to continue work on this issue has not been supplied in the past 12 months. Therefor, closing this as explained in #26.