Skip to content
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

Import manager improvements #2862

Merged
merged 10 commits into from
Apr 27, 2019
Merged

Import manager improvements #2862

merged 10 commits into from
Apr 27, 2019

Conversation

dharizza
Copy link
Contributor

If in a site we need to execute any steps right after the import to datastore process, right now we don't have an easy way to do it, so in this PR we are introducing a new hook. This hook is called hook_datastore_post_import and it is fired when an import process is completed.

Right now, the dkan datastore tables don't have a primary key field, which may lead to issues when someone needs to index the items from a datastore, so in this PR we're also altering the datastore table schema to include a serial entry_id field which will work as the primary key.

QA Steps

  • Import a resource to the datastore, the resulting table should contain a field entry_id as primary key.
  • Implement a hook_datastore_post_import and make sure it fires after a resource is imported into the datastore.

@@ -235,6 +245,7 @@ public function import() {
if ($import_state === self::DATA_IMPORT_DONE) {
$this->stateDataImport = self::DATA_IMPORT_DONE;
$this->saveState();
module_invoke_all('datastore_post_import', $this->resource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dharizza do we still need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we do, because that's what will allow us to execute custom actions after a datastore import is completed.

@janette janette merged commit 0fd5923 into 7.x-1.x Apr 27, 2019
@janette janette deleted the import-manager-improvements branch April 27, 2019 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants