Skip to content
Snippets Groups Projects

Remove deprecated code.

Open fromme requested to merge issue/drupal-3439369:3439369-removed-deprecated-code into 11.x
2 unresolved threads

Closes #3439369

Merge request reports

Members who can merge are allowed to add commits.

Merged results pipeline #154130 passed

Pipeline: drupal

#154136

    Merged results pipeline passed for 960af210

    Approval is optional
    Merge blocked: 1 check failed

    Merge details

    • The source branch is 1639 commits behind the target branch.
    • 1 commit will be added to 11.x.
    • Source branch will not be deleted.

    Activity

    Filter activity
    • Approvals
    • Assignees & reviewers
    • Comments (from bots)
    • Comments (from users)
    • Commits & branches
    • Edits
    • Labels
    • Lock status
    • Mentions
    • Merge request status
    • Tracking
  • 700 655 [$this->migrationPluginManager, 'expandPluginIds'],
    701 656 $this->migration_dependencies
    702 657 );
    703 658 }
    • Comment on lines 675 to 703

      This deprecation is more complex - we need to remove $expand and the FALSE code path and issue a deprecation if an arg is passed in. Something like...

      Suggested change
      638 * @param bool $expand
      639 * Set TRUE if migration dependencies need to be expanded, otherwise FALSE.
      640 *
      641 * @return array
      642 * The dependencies for this migration.
      643 */
      644 public function getMigrationDependencies(bool $expand = FALSE) {
      645 $this->migration_dependencies = ($this->migration_dependencies ?: []) + ['required' => [], 'optional' => []];
      646 if (count($this->migration_dependencies) !== 2 || !is_array($this->migration_dependencies['required']) || !is_array($this->migration_dependencies['optional'])) {
      647 throw new InvalidPluginDefinitionException($this->id(), "Invalid migration dependencies configuration for migration {$this->id()}");
      648 }
      649 $this->migration_dependencies['optional'] = array_unique(array_merge($this->migration_dependencies['optional'], $this->findMigrationDependencies($this->process)));
      650 if (!$expand) {
      651 return $this->migration_dependencies;
      652 }
      653 return array_map(
      654 [$this->migrationPluginManager, 'expandPluginIds'],
      655 $this->migration_dependencies
      656 );
      657 }
      638 /**
      639 * Get the dependencies for this migration.
      640 *
      641 * @return array
      642 * The dependencies for this migration.
      643 */
      644 public function getMigrationDependencies() {
      645 if (func_num_args() > 0) {
      646 @trigger_error('@TODO', E_USER_DEPRECATED);
      647 }
      648
      649 $this->migration_dependencies = ($this->migration_dependencies ?: []) + ['required' => [], 'optional' => []];
      650 if (count($this->migration_dependencies) !== 2 || !is_array($this->migration_dependencies['required']) || !is_array($this->migration_dependencies['optional'])) {
      651 throw new InvalidPluginDefinitionException($this->id(), "Invalid migration dependencies configuration for migration {$this->id()}");
      652 }
      653 $this->migration_dependencies['optional'] = array_unique(array_merge($this->migration_dependencies['optional'], $this->findMigrationDependencies($this->process)));
      654
      655 return array_map(
      656 [$this->migrationPluginManager, 'expandPluginIds'],
      657 $this->migration_dependencies
      658 );
      659 }

      And we need to fix all the calls to \Drupal\migrate\Plugin\Migration::getMigrationDependencies() in core to not pass an argument.

    • Done

    • Please register or sign in to reply
  • Pradhuman Jain added 1 commit

    added 1 commit

    Compare with previous version

  • fromme added 1 commit

    added 1 commit

    Compare with previous version

  • fromme added 1 commit

    added 1 commit

    • 2e77d785 - Fix call to getMigrationDependencies()

    Compare with previous version

  • fromme added 1 commit

    added 1 commit

    Compare with previous version

  • fromme added 1 commit

    added 1 commit

    Compare with previous version

  • 677 638 *
    678 * @param bool $expand
    679 * Will issue a deprecation in Drupal 10 if set to FALSE. See
    680 * https://www.drupal.org/node/3266691.
    681 *
    682 639 * @return array
    683 * The dependencies for this migrations.
    640 * The dependencies for this migration.
    684 641 */
    685 public function getMigrationDependencies(bool $expand = FALSE) {
    686 if (!$expand) {
    687 @trigger_error('Calling Migration::getMigrationDependencies() without expanding the plugin IDs is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. In most cases, use getMigrationDependencies(TRUE). See https://www.drupal.org/node/3266691', E_USER_DEPRECATED);
    642 public function getMigrationDependencies() {
    643 if (func_num_args() > 0) {
    644 // phpcs:ignore Drupal.Semantics.FunctionTriggerError
    645 @trigger_error(sprintf('Passing parameter to %s is disallowed', __METHOD__), E_USER_DEPRECATED);
  • quietone added 134 commits

    added 134 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading