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.
Problem/Motivation
In README.md one example lists "overwrite": true
under extra > drupal-scaffold.
If I interpret the code correctly, it is not possible to set a default 'overwrite' at scaffold level. \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions::__construct
does not define an 'overwrite' default. Overwriting is default, but adding it explicitly to an example at scaffold level gives a wrong signal as if other defaults are possible.
Proposed resolution
Update the documentation.
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-3101210-2-5.txt | 444 bytes | mrinalini9 |
#5 | drupal-compososer-scaffold-overwrite-3101210-5.patch | 1.15 KB | mrinalini9 |
#2 | drupal-compososer-scaffold-overwrite-3101210-2.patch | 524 bytes | Sutharsan |
Comments
Comment #2
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedComment #4
Kristen PolThanks for the patch.
Maybe I'm misunderstanding this but I see:
in
here:
If what you have in the issue summary is correct, should this be removed here as well?
Moving back to "Needs work" in case that's true.
Comment #5
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedRerolled patch to 9.1.x with the changes mentioned in #4 as I think it should be removed here as well.
Comment #6
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedComment #7
Kristen PolThanks for the update.
1) Reviewed the interdiff and changes seem ok (assuming this is the correct approach).
2) Patch applies cleanly to 8.9, 9.0, and 9.1
3) Searching for
"overwrite": true
after patching I find:but these are under
file-mapping
.4) I'm hesitant to mark RTBC as I don't know enough about the structure to convince myself the changes are needed and correct. Leaving as "Needs review" for others more familiar with the code.
Comment #8
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedIn the ancient past (pre-Drupal 8.8.0, during development), the Scaffold Plugin had a top-level "overwrite" property that could be used to invert the default behavior of the replace op. This property was deemed to not be useful and perhaps confusing, so it was removed. Mostly.
This patch correctly identifies the places where vestigial references to this property remained, and should be removed. "Overwrite" is still a property of the replace op itself (for setting the overwrite behavior on a file-by-file basis); the places identified in #7 where it remains are appropriate and correct references.
Comment #9
greg.1.anderson CreditAttribution: greg.1.anderson at Pantheon commentedComment #10
alexpottCommitted and pushed 8ac02b5cbd to 9.1.x and 4b72c1c605 to 9.0.x and 8d61bcad63 to 8.9.x. Thanks!
Backported all the way to 8.9.x because this is a docs and template fix. We could also choose to backport this to 8.8.x is we want.