Comments (6)
@pamil Could you advice best way to add a generic export controller that can act similar to ResourceController without extending it (else it's tedious for users of this plugin to get each exporter working)? Would like to use the same filters/data fetching as being used on the 'indexAction' in the ResourceController..
Doing something like this doesn't really get it working (WIP) with such URL: http://webshop.test.local/app_dev.php/admin/export/country/csv?criteria%5Bcode%5D%5Btype%5D=contains&criteria%5Bcode%5D%5Bvalue%5D=nl&criteria%5Benabled%5D=
// Get metadata config
// @todo Allow for non-sylius resources
$metadata = Metadata::fromAliasAndConfiguration('sylius.' . $exporter, $this->container->getParameter('sylius.resources')['sylius.'.$exporter]);
$configuration = $this->requestConfigurationFactory->create($metadata, $request);
dump($metadata);
dump($configuration);
$resources = $this->resourcesCollectionProvider->get($configuration, $repository);
dump($resources);
I have 2 countries (BE & NL), and in this case only expected NL in the results, but both are. I'm probably overlooking something that makes it pass the criteria
GET param to the resolver..
from syliusimportexportplugin.
Ok, adding
_sylius:
paginate: false
filterable: true
to the routing helps, but now it's 0 results :-)
from syliusimportexportplugin.
Nm, issue with the fact that 'enabled' didn't have a value while filtering. Seems unrelated.
from syliusimportexportplugin.
Not sure why on the normal grid an empty value for 'enabled' works (it shows one result), but if in the URL in my example it's not returning a result. Might be a bug in resource resolving?
from syliusimportexportplugin.
To make it more clear for @pamil:
I'm using this URL on the grid: http://webshop.test.local/app_dev.php/admin/export/country/csv?criteria[code][type]=contains&criteria[code][value]=nl&criteria[enabled]=
.
It returns NL only on the grid. In the database I have NL & BE, that's all. This is expected behavior.
When using the same URL filtering as in PR (#81), the NL is not in the result (result is empty). Adjusting the URL to http://webshop.test.local/app_dev.php/admin/export/country/csv?criteria[code][type]=contains&criteria[code][value]=nl
solves it and NL is in the export. It seems due to no value for enabled
, but that works on the Grid. Not sure therefore why this is an issue.
from syliusimportexportplugin.
Some progress being made in #81. Not sure it's the best solution though.
from syliusimportexportplugin.
Related Issues (20)
- Exporter relies on deprecated `money_format()` function HOT 4
- Allow to use with Sylius 1.10.0 HOT 1
- export button on invoice plugin HOT 1
- Export data from related columns
- PHP 8.0 support HOT 2
- Error importing taxonomies HOT 2
- PHP 8.0: CSV Product Import does not work anymore HOT 1
- Sylius 1.11 and PHP 8 support HOT 2
- Import product reference problem HOT 1
- Is it possible to import product images? HOT 2
- Composer installs a very old version of the plugin HOT 1
- Route path conflict between SyliusImportExportPlugin and BitBagCMSPlugin
- Allow API platform 2.7
- Sylius 1.12.5 and Symfony 6: Web UI fails with Controller "sylius.controller.import_data:importFormAction" does neither exist as service nor as class HOT 3
- import DateTimeInterface
- Symfony 6 Sylius 1.12 / issue HOT 1
- Update for Symfony 7 HOT 1
- export two resources in same export
- Override ExportButtonGridListener
- export custom data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syliusimportexportplugin.