Problem/Motivation

The default config file core.base_field_override.node.varbase_heroslider_media.uid.yml
has default_value_callback: 'Drupal\node\Entity\Node::getCurrentUserId'
But getCurrentUserId is deprecated in Drupal 9

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

Proposed resolution

From

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

To

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

  • Update for core.base_field_override.node.varbase_heroslider_media.uid
  • And all content types in the active config.

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.

  • RajabNatshah committed 8f42d57 on 9.0.x
    Issue #3175810: Fix deprecated function getCurrentUserId replaced by...

  • RajabNatshah committed 7658405 on 8.x-7.x
    Issue #3175810: Fix deprecated function getCurrentUserId replaced by...
rajab natshah’s picture

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

Assigned: mohammed j. razem » Unassigned

  • RajabNatshah committed 66ecd15 on 8.x-7.x
    Issue #3175810: Fix deprecated function getCurrentUserId replaced by...

  • RajabNatshah committed 9e30e03 on 9.0.x
    Issue #3175810: Fix deprecated function getCurrentUserId replaced by...
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Title: Fix deprecated function getCurrentUserId replaced by getDefaultEntityOwner in core.base_field_override.node.varbase_heroslider_media.uid config » Fix deprecated function getCurrentUserId replaced by getDefaultEntityOwner in core.base_field_override.node.varbase_heroslider_media.uid config for Drupal 9 compatibility
rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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