GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
373 stars 171 forks source link

Deprecated: Creation of dynamic property :$has_json_form_widget #4153

Closed swirtSJW closed 7 months ago

swirtSJW commented 7 months ago

This is caused by PHP 8.2 not liking undeclared properties.
https://php.watch/versions/8.2/dynamic-properties-deprecated

Describe the bug

Seeing this error while editing a dataset

Deprecated function: Creation of dynamic property Drupal\Core\Form\FormState::$has_json_form_widget is deprecated in json_form_widget_field_widget_complete_form_alter() (line 79 of modules/contrib/dkan/modules/json_form_widget/json_form_widget.module).
json_form_widget_field_widget_complete_form_alter(Array, Object, Array) (Line: 545)
Drupal\Core\Extension\ModuleHandler->alter('field_widget_complete_form', Array, Object, Array) (Line: 147)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 183)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('node_data_edit_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 52)
Drupal\pqdc\Middleware\Redirect->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps To Reproduce

Expected behavior

paul-m commented 7 months ago

Fixed in https://github.com/GetDKAN/dkan/pull/4129

That's in 2.18.1 released today: https://github.com/GetDKAN/dkan/releases/tag/2.18.1

swirtSJW commented 7 months ago

Oh I see it here https://github.com/GetDKAN/dkan/pull/4129. Sorry for the noise. Thanks for the fix @paul-m and for connecting the dots for me.