- Issue created by @tgoeg
- last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago 535 pass - Status changed to Needs review
about 1 year ago 5:33pm 18 September 2023 - last update
about 1 year ago 535 pass - 🇺🇸United States jrockowitz Brooklyn, NY
The issue makes sense. The patch is a guess at fixing the issue via the drush command.
- last update
about 1 year ago 535 pass - 🇦🇹Austria tgoeg
Right, with more knowledge of the code this is the correct place to fix it, i.e. only for the drush command and not globally as my attempt did.
I built on top of that and removed the extraneous adding of default options, assetExporter()
does it anyway and that function gets used by the webGUI-based export as well, so it should stay there (though it might be better to get the default options only once, before callingsetExporter()
, in both cases of drush and webGUI-based export.
The measured overhead however is minimal, caching and PHP optimizations seem to take care of it.Tested it with and with my removed line.
In both cases, theuuid
column is not exported, as it is part of default excluded columns.Works for me!
- 🇮🇳India bebalachandra
Tested patch #5 and patch #6 on my local drupal 10.1. Firstly Please note that both patches are same, only the difference in patch #6 is removal of 171 line i.e " $export_options += $submission_exporter->getDefaultExportOptions();". Done testing with this line of code and without also. Both cases the result is same. "--excluded-colums" is working as expected after applying both patches. attaching Screenshot for reference. Let maintainer decide which is the best patch to consider. Both patches resolve the issue which is stated here.
We can move this to RTBC+1
- 🇺🇸United States jrockowitz Brooklyn, NY
I am confused by #6. Removing the default export options will likely cause unexpected regressions for other people.
- 🇮🇳India bebalachandra
In that case, better we can consider #5 which is mainly focused on this ticket.
- 🇦🇹Austria tgoeg
Removing the default export options will likely cause unexpected regressions for other people.
No, it won't, as they are not removed.
As already laid out,
src/Commands/WebformSubmissionCommands.php
calls
172 $submission_exporter->setExporter($export_options);
(Additionally to
171 $export_options += $submission_exporter->getDefaultExportOptions();
)This in turn, in
setExporter()
in
src/WebformSubmissionExporter.php:
calls
$export_options += $this->getDefaultExportOptions();
So you end up calling
getDefaultExportOptions();
twice (and adding it to the$export_options
).As also laid out and tested, the default options do get set with only one call (which should be no surprise).
Yours to decide.
I can open up a second issue as well, if you like.
- Status changed to RTBC
about 1 year ago 10:02am 2 October 2023 - 🇺🇸United States jrockowitz Brooklyn, NY
Yep @togoeg stepped thru the code and confirmed the default options are always applied via \Drupal\webform\WebformSubmissionExporter::setExporter.
The patch from #6 is RTBC. This can be backported to 6.1.x
- last update
about 1 year ago 535 pass - last update
about 1 year ago 535 pass -
Liam Morland →
committed fecd9fb6 on 6.2.x authored by
tgoeg →
Issue #3388073 by tgoeg, jrockowitz, bebalachandra: Remove unnecessary...
-
Liam Morland →
committed fecd9fb6 on 6.2.x authored by
tgoeg →
-
Liam Morland →
committed 46245c44 on 6.2.x authored by
tgoeg →
Issue #3388073 by tgoeg, jrockowitz, bebalachandra: Make 'drush webform:...
-
Liam Morland →
committed 46245c44 on 6.2.x authored by
tgoeg →
- Status changed to Fixed
about 1 year ago 3:50pm 4 October 2023 Automatically closed - issue fixed for 2 weeks with no activity.