Skip to content

Incorrect mime_type in DatasetInfo #4432

@kaise-lafrai

Description

@kaise-lafrai

Current Behavior

Create dataset with a csv file in the distribution section. Run import. Import run successfuly. Now update the distribution to a non-importable resource type like a .pdf. Run import. Import should be unsuccessful. Run drush dkan:dataset-info uuid. Notice that the mime_type still says text/csv when it sould say application/pdf.

Expected Behavior

mime_type should align with the current resource type in the distribution.

Steps To Reproduce

Create dataset with a csv file in the distribution section. Run import. Import run successfuly. Now update the distribution to a non-importable resource type like a .pdf. Run import. Import should be unsuccessful. Run drush dkan:dataset-info uuid. Notice that the mime_type still says text/csv when it sould say application/pdf.

Relevant log output (optional)

Example dataset info

mime_type is: text\/csv
file is a .pdf

macbookpro:dkan kaiselafrai$ ddev drush dkan:dataset-info 5dc1cfcf-8028-476c-a020-f58ec6dd621c
{
    "latest_revision": {
        "uuid": "5dc1cfcf-8028-476c-a020-f58ec6dd621c",
        "node_id": "46",
        "revision_id": "82",
        "moderation_state": "published",
        "title": "Gold Prices in London 1950-2008 (Monthly)",
        "modified_date_metadata": "2010-06-06T04:00:00+00:00",
        "modified_date_dkan": "2025-03-10T17:02:59-0400",
        "distributions": [
            {
                "distribution_uuid": "44c21094-b52c-5832-912a-a43b74b4d54a",
                "resource_id": "df89a5929c4ad12b19be01e309785d9c",
                "resource_version": "1741630365",
                "mime_type": "text\/csv",
                "source_path": "https:\/\/h-o.st\/sites\/default\/files\/uploaded_resources\/Lafrai_Kaise_Resume_24%20%281%29_1.pdf",
                "fetcher_status": "done",
                "fetcher_percent_done": 100,
                "file_path": "public:\/\/resources\/df89a5929c4ad12b19be01e309785d9c_1741630365\/Lafrai_Kaise_Resume_24 (1)_1.pdf",
                "importer_percent_done": 0,
                "importer_status": "waiting",
                "importer_error": "",
                "table_name": "datastore_97aab4b1719a9879a57a6e19a6f4263e"
            },
            {
                "distribution_uuid": "3810a99f-880e-51f1-b014-4219345e9d18",
                "resource_id": "588edd8c0c7efb5d7731e574634d500c",
                "resource_version": "1741640580",
                "mime_type": "text\/csv",
                "source_path": "https:\/\/h-o.st\/sites\/default\/files\/uploaded_resources\/datastore-simple%20%282%29_3.csv",
                "fetcher_status": "done",
                "fetcher_percent_done": 100,
                "file_path": "public:\/\/resources\/588edd8c0c7efb5d7731e574634d500c_1741640580\/datastore-simple (2)_3.csv",
                "importer_percent_done": 100,
                "importer_status": "done",
                "importer_error": "",
                "table_name": "datastore_3683954c0a4d4d7711a6b896ec7156c6"
            }
        ]
    }

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions