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)

Comments

jasonluttrell created an issue. See original summary.

bbu23’s picture

Hello,

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!

bbu23’s picture

I have attached a patch with the fix, plus coding standards improvements.

bbu23’s picture

StatusFileSize
new5.41 KB

Sorry, forgot some debugging stuff. Here's the correct version.

bbu23’s picture

Status: Active » Needs review

  • spotzero committed e82b66a on 8.x-1.x authored by bbu23
    Issue #3169236 by bbu23: Drupal 9 compatibility issue
    
spotzero’s picture

Status: Needs review » Fixed

Tested and looks like it's working. Applied. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.