Skip to content

Commit

Permalink
Fix json_form_widget deprecation messages in PHP 8.2 (#4129)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-m authored Feb 22, 2024
1 parent c243fca commit a9cf4dc
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 263 deletions.
90 changes: 0 additions & 90 deletions cypress/integration/07_admin_dataset_json_form.spec.js

This file was deleted.

169 changes: 0 additions & 169 deletions cypress/integration/11_admin_dataset_file_upload.spec.js

This file was deleted.

6 changes: 3 additions & 3 deletions modules/json_form_widget/json_form_widget.module
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function _json_form_widget_build_count_property(array $button_element): array {
*/
function json_form_widget_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, $context) {
if ($context['widget'] instanceof JsonFormWidget) {
$form_state->has_json_form_widget = TRUE;
$form_state->set('has_json_form_widget', TRUE);
}
}

Expand All @@ -86,10 +86,10 @@ function json_form_widget_field_widget_complete_form_alter(&$field_widget_comple
* Add custom submit handler to form if it contains an upload_or_link element.
*/
function json_form_widget_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (!isset($form['actions']['submit']) || !isset($form_state->has_json_form_widget)) {
if (!isset($form['actions']['submit'])) {
return;
}
if ($form_state->has_json_form_widget) {
if ($form_state->get('has_json_form_widget')) {
$form['actions']['submit']['#submit'][] = 'json_form_widget_file_submit';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class JsonFormWidget extends WidgetBase {
protected ?string $schema;

/**
* Constructs a WidgetBase object.
* Constructs a JsonFormWidget object.
*
* @param string $plugin_id
* The plugin_id for the widget.
Expand Down
Loading

0 comments on commit a9cf4dc

Please sign in to comment.