After installing this module in Drupal 9, and saving an article, I get the following error message:
Notice: Object of class Drupal\Core\Field\FieldItemList could not be converted to int in published_corrected_date_entity_presave() (line 51 of modules/contrib/published_corrected_date/published_corrected_date.module).
published_corrected_date_entity_presave(Object)
call_user_func_array('published_corrected_date_entity_presave', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array) (Line: 201)
Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object) (Line: 800)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object) (Line: 495)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 657)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 449)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 801)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 270)
Drupal\node\NodeForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 113)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('node_article_edit_form', Array, Object) (Line: 321)
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: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | published_corrected_date-compatibility_issue-3169236-4.patch | 5.41 KB | bbu23 |
Comments
Comment #2
bbu23Hello,
May I ask how did you install the module on Drupal 9? Did you use composer? Did you modify anything in the project files before enabling it? I noticed that it is not compatible yet with this version. Thanks!
Comment #3
bbu23I have attached a patch with the fix, plus coding standards improvements.
Comment #4
bbu23Sorry, forgot some debugging stuff. Here's the correct version.
Comment #5
bbu23Comment #7
spotzero commentedTested and looks like it's working. Applied. Thanks.