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

Miscellaneous error fixing in json_form_widget and metastore.theme.inc #3968

Merged
merged 4 commits into from
May 15, 2023

Conversation

jastraat
Copy link
Contributor

@jastraat jastraat commented May 15, 2023

Fixes the following errors:

  • Unable to use add buttons for distribution/related documents when adding a dataset node through the UI
  • PHP error when viewing dataset node page (not in React) when distribution does not have a title: Warning: Undefined property: stdClass::$title in metastore_preprocess_node__data() (line 103 of /var/www/html/docroot/modules/contrib/dkan/modules/metastore/metastore.theme.inc)
  • PHP errors when creating a new dataset through the UI: Deprecated function: json_decode(): Passing null to parameter 1 ($json) of type string is deprecated in Drupal\json_form_widget\Plugin\Field\FieldWidget\JsonFormWidget->formElement() (line 117 of /var/www/html/docroot/modules/contrib/dkan/modules/json_form_widget/src/Plugin/Field/FieldWidget/JsonFormWidget.php) and Deprecated function: preg_match(): Passing null to parameter 2 ($subject) of type string is deprecated in Drupal\Component\Utility\UrlHelper::isValid() (line 396 of /var/www/html/docroot/core/lib/Drupal/Component/Utility/UrlHelper.php)

QA Steps

In a vanilla installation of DKAN:

  1. Enable the Database Logging module if not already enabled.
  2. Visit /node/add/data and create a dataset through the UI that has a distribution with an empty title field.
  3. Click the 'add one' button to add another distribution. It succeeds.
  4. Save the dataset node.
  5. Visit the node path (e.g. node/[id]) for the newly created dataset node.
  6. Check the recent log messages (/admin/reports/dblog) and confirm there are no PHP errors.

@jastraat jastraat requested review from dafeder and janette May 15, 2023 16:13
@janette janette merged commit 858925a into 2.x May 15, 2023
@janette janette deleted the frontend_tweaks branch May 15, 2023 20:04
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.

None yet

2 participants