Problem/Motivation

Deprecated
The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.

Proposed resolution

Change for all cotnent types

From

default_value_callback: 'Drupal\node\Entity\Node::getCurrentUserId'

To

default_value_callback: 'Drupal\node\Entity\Node::getDefaultEntityOwner'
and have a hook update function

#3175756: Fix deprecated function getCurrentUserId replaced by getDefaultEntityOwner in core.base_field_override.node.landing_page_lb.uid config

Change for all media types

From

default_value_callback: 'Drupal\media\Entity\Media::getCurrentUserId'

To

default_value_callback: 'Drupal\media\Entity\Media::getDefaultEntityOwner'

#3171237: Fix deprecated function getCurrentUserId replaced by getDefaultEntityOwner in core.base_field_override.media.*.uid configs for Drupal 9 compatibility

Remaining tasks

  • Fix
  • Test
  • Release

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Issue tags: +Drupal 9 compatibility
rajab natshah’s picture

Issue summary: View changes

  • RajabNatshah committed 60c1836 on 9.0.x
    Issue #3175792: Fix deprecated function getCurrentUserId replaced by...

  • RajabNatshah committed 5529af8 on 8.x-8.x
    Issue #3175792: Fix deprecated function getCurrentUserId replaced by...
rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Status: Active » Needs review
Issue tags: +varbase-8.8.7, +varbase-9.0.0
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue tags: +varbase-9.0.0-alpha1

Status: Fixed » Closed (fixed)

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