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

json_form_widget throws deprecation messages in PHP 8.2 #4129

Merged
merged 13 commits into from
Feb 22, 2024
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