-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Xlsx export issue with ES8 and Advanced Object Search 5 #256
Comments
It appears that [
0 = "ArticleId",
1 = "#62ffa09829873",
2 = "SystemArticleName",
3 = "MainMaterialCompositions",
4 = "MainGroup",
5 = "ArtGroup",
6 = "Subgroup",
7 = "#62ffa09829875",
8 = "#62ffa09829876",
9 = "#62ffa09829877",
10 = "#62ffa09829878",
11 = "#62ffa09829879",
12 = "#62ffa0982987a",
] But it should be something like according to [
0 = ['key' => something, 'label' => something else ],
1 = ['key' => something, 'label' => something else ],
2 = ['key' => something, 'label' => something else ],
3 = ['key' => something, 'label' => something else ],
4 = ['key' => something, 'label' => something else ],
and so on…
] |
I don't know if this is a case of missing migration due to changed configuration data structure in Pimcore 11 vs 10 or something else. |
@NiklasBr we also encountered the same issue. |
@jtwogw unfortunately I have not been able to find any solution. |
@jtwogw I think this patch for Index: src/Controller/Admin/DataObject/DataObjectHelperController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Controller/Admin/DataObject/DataObjectHelperController.php b/src/Controller/Admin/DataObject/DataObjectHelperController.php
--- a/src/Controller/Admin/DataObject/DataObjectHelperController.php
+++ b/src/Controller/Admin/DataObject/DataObjectHelperController.php (date 1709637349450)
@@ -1340,7 +1340,13 @@
$list = $beforeListExportEvent->getArgument('list');
- $fields = json_decode($request->get('fields')[0], true);
+ $fields = [];
+ foreach ($request->get('fields') as $field) {
+ $fields[] = [
+ 'key' => $field,
+ 'label' => $field,
+ ];
+ }
$addTitles = (bool) $request->get('initial');
I have no idea if it has any side effects or if there is a better way to fix it, but now we can at least export from Advanced Object Search again. |
@NiklasBr it has a side effect, "[{"key":"id","label":"id"},{"key":"fullpath","label":"fullpath"},{"key":"published","label":"published"},{"key":"name","label":"Name"}]" |
That's a good catch @jtwogw, try this adjusted patch which should work on both regular grid view and Advanced Object Search: Index: src/Controller/Admin/DataObject/DataObjectHelperController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Controller/Admin/DataObject/DataObjectHelperController.php b/src/Controller/Admin/DataObject/DataObjectHelperController.php
--- a/src/Controller/Admin/DataObject/DataObjectHelperController.php
+++ b/src/Controller/Admin/DataObject/DataObjectHelperController.php (date 1709637349450)
@@ -1340,7 +1340,17 @@
$list = $beforeListExportEvent->getArgument('list');
- $fields = json_decode($request->get('fields')[0], true);
+ if (json_validate($request->get('fields')[0])) {
+ $fields = json_decode($request->get('fields')[0], true);
+ } else {
+ $fields = [];
+ foreach ($request->get('fields') as $field) {
+ $fields[] = [
+ 'key' => $field,
+ 'label' => $field,
+ ];
+ }
+ }
$addTitles = (bool) $request->get('initial');
|
@NiklasBr Made this temporary fix, this change the request parameter from Advanced-Object-Search module instead of changing on Pimcore DataObjectHelperController. From here: Not sure if this is a good place to fix the issue, anyway this works for both cases in my case. --- For Prod ENV -- |
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding. |
Expected behavior
A file to be downloaded.
Actual behavior
Issue can be seen here where
$fields
isnull
.Steps to reproduce
The text was updated successfully, but these errors were encountered: