You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an ideas discussion thread for how to allow more automated data loading with the dev seed project in mind (and perhaps this discussion/utility will end up there instead).
Constraints
Loaders are never bootstrapped, they must be manually loaded
I think the easy way to run the loader is to provide a simulated $form and $form_state as required by the Importer. This is because some private methods move the file to temp etc, and the functions used to actually run the loader might be private.
I'd love to use a drush command, but passing a fake form isn't really possible with Drush -> you'd have to write a seperate drush command for each loader to allow the options to be passed in.
Could a db:seeder be better? Lets you run it via the command line, assuming you can pass a file path and whatever options needed.
The text was updated successfully, but these errors were encountered:
Note that i dont actually simulate form and form_state: instead I execute create with the $run_args (from the form) and the $file which is where the file goes from the GUI.
$importer = new \SSRLoader();
$importer->create($run_args, $file);
$importer->run();
This is an ideas discussion thread for how to allow more automated data loading with the dev seed project in mind (and perhaps this discussion/utility will end up there instead).
Constraints
Loaders are never bootstrapped, they must be manually loaded
I think the easy way to run the loader is to provide a simulated
$form
and$form_state
as required by the Importer. This is because some private methods move the file to temp etc, and the functions used to actually run the loader might be private.I'd love to use a
drush
command, but passing a fake form isn't really possible with Drush -> you'd have to write a seperate drush command for each loader to allow the options to be passed in.Could a
db:seeder
be better? Lets you run it via the command line, assuming you can pass a file path and whatever options needed.The text was updated successfully, but these errors were encountered: