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

Check if downloadURL isset before rendering #4197

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

dgading
Copy link
Member

@dgading dgading commented Jun 20, 2024

fixes #4194

QA Steps

  1. Build the demo site and install sample data. Visit a dataset /node page to make sure the template still adds the download urls to the page.
  2. Create a new dataset. Fill in the required fields.
  3. For the distribution section, add a new distribution, leaving Download URL section empty and adding an Access URL. This will make the frontend render this section and you will not see the error. (The access url does not render well since it didn't have an explicit variable set in the theme file.)

I've also added the variable metastore for templates to use. This is just the raw json object with no processing on it. This is the first step towards deprecating the dataset variables. The new metastore variable can be used in node--data templates by using something like metastore.title or metastore.keyword[0].

Warning: Undefined array key "downloadURL" in metastore_preprocess_node__data() (line 101 of /var/www/html/docroot/modules/contrib/dkan/modules/metastore/metastore.theme.inc)

@dgading dgading requested a review from dafeder June 20, 2024 16:08
@dafeder dafeder self-assigned this Jun 24, 2024
Copy link
Member

@dafeder dafeder left a comment

Choose a reason for hiding this comment

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

This accomplishes the goal of the ticket, which was to remove the error at the top. We should not as a known issue though that distributions do not render particularly coherently if there is an accessURL instead of a downloadURL.

@dafeder dafeder merged commit e950090 into 2.x Jun 25, 2024
10 checks passed
@dafeder dafeder deleted the fix-undefined-downloadurl branch June 25, 2024 15:07
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.

Undefined array key "downloadURL" in metastore process node data
2 participants