Problem/Motivation

The issue #3051766: Deprecate and replace jQuery Joyride (for tours) added multiple @todos to some /tour classes, most of them were addressed at #3195193: Remove Shepherd shim code from Tour but one was left to be done as it seemed unrelated to the rest of the changes on the issue. So here is a follow up to address it.

Proposed resolution

Move all methods from TourTipPluginInterface to TipPluginInterface and deprecate TourTipPluginInterface.

Remaining tasks

Create patch.
Review it.
Commit.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3276336

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3276336-move-metod Comparecompare

Comments

andregp created an issue. See original summary.

Jesse van de Water made their first commit to this issue’s fork.

jesse van de water’s picture

StatusFileSize
new4.18 KB
jesse van de water’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

The last patch doesn't pass commit checks, could you make sure to run ./core/scripts/dev/commit-code-check.sh before uploading a patch to make sure there are no issues with code formatting. see https://www.drupal.org/docs/develop/development-tools/running-core-devel...

ankitsingh0188’s picture

StatusFileSize
new6.73 KB
ankitsingh0188’s picture

StatusFileSize
new6.62 KB
ankitsingh0188’s picture

StatusFileSize
new6.73 KB
smustgrave’s picture

Please include interdiffs with your patches. fyi

ankitsingh0188’s picture

StatusFileSize
new6.62 KB
new2.5 KB
ankitsingh0188’s picture

StatusFileSize
new6.73 KB
ankitsingh0188’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Fyi you should include interdiffs for all your patches. No easy way to tell what's changed between your patches thus delaying this.
Also the patch names should be updated for the comment

Failures in the patch in #11 so moving to NW.

ankitsingh0188’s picture

All the patches are same, only the difference of the relative file path as patch was failed to apply earlier. I have included the interdiff in #10

Additionally the patches are failing in #11 but I ran the test again and it successfully passed.

If you see the error you’ll get to know due to date mismatch test failed just because after 12 midnight the day changes.

ankitsingh0188’s picture

StatusFileSize
new2.5 KB
new6.73 KB
ankitsingh0188’s picture

Status: Needs work » Needs review
rinku jacob 13’s picture

Reviewed patch #15 on drupal version -10.0.x-dev. The patch was successfully applied and removed TourTipPluginInterface file and Moved all methods from TourTipPluginInterface to TipPluginInterface. Need RTBC+1.

ankitsingh0188’s picture

Status: Needs review » Reviewed & tested by the community

Good to move to RTBC.

catch’s picture

Status: Reviewed & tested by the community » Needs work

This needs an additional person to RTBC it.

ankitsingh0188’s picture

Status: Needs work » Needs review
murilohp’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests, +Needs change record
+++ /dev/null
@@ -1,58 +0,0 @@
-interface TourTipPluginInterface extends TipPluginInterface {

The ideal here would be deprecate this interface instead of remove it directly. You can do something like:

<?php

namespace Drupal\tour;

@trigger_error('The ' . __NAMESPACE__ . '\TourTipPluginInterface is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Implement ' . __NAMESPACE__ . '\TipPluginInterface instead. See {CHANGE RECORD}.', E_USER_DEPRECATED);

/**
 * Defines an interface for tour items.
 *
 * @see \Drupal\tour\Annotation\Tip
 * @see \Drupal\tour\TipPluginBase
 * @see \Drupal\tour\TipPluginManager
 * @see plugin_api
 * 
 * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. The TourTipPluginInterface were moved
 * to TipPluginInterface.
 *
 * @see {CHANGE RECORD}
 */
interface TourTipPluginInterface extends TipPluginInterface {}

It also needs tests for the deprecation part, for that you can do something like:

<?php

namespace Drupal\Tests\tour\Kernel;

use Drupal\tour\TourTipPluginInterface;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;

/**
 * @coversDefaultClass \Drupal\tour\TourTipPluginInterface
 * @group tour
 * @group legacy
 */
class TourTipLegacyTest extends TestCase {

  use ExpectDeprecationTrait;

  public function testPluginHelperDeprecation(): void {
    $this->expectDeprecation('The Drupal\tour\TourTipPluginInterface is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Implement Drupal\tour\TipPluginInterface instead. See {CHANGE RECORD}.');
    $plugin = $this->createMock(TourTipPluginInterface::class);
    $this->assertInstanceOf(TourTipPluginInterface::class, $plugin);
  }

}

That's it, I'm moving this back to NW, for the deprecation part, tests and the change record.

ankitsingh0188’s picture

Status: Needs work » Needs review
StatusFileSize
new8.18 KB
new3.2 KB
ankitsingh0188’s picture

StatusFileSize
new8.19 KB

Interdiff is same as mentioned in #22

ankitsingh0188’s picture

StatusFileSize
new8.23 KB
new651 bytes
smustgrave’s picture

Status: Needs review » Needs work

Tests and Change record

ankitsingh0188’s picture

@smustgrave what changes exactly can you please elaborate?

smustgrave’s picture

Issue tags: -Needs tests

Removing tests tag. Would also help to put a comment of what you are doing between patches in addition to an interdiff, to quickly see you added tests.

Still needs a change record, which would then need to be added to the patch.

Did not do a code review.

ankitsingh0188’s picture

Issue tags: -Needs change record

@smustgrave Still needs a change record, which would then need to be added to the patch. -> Please help me with this I have added the tests and refactor the whole interface also, if there's anything else missing please let me know.

murilohp’s picture

Status: Needs work » Needs review
StatusFileSize
new7.75 KB
new8.95 KB

Hey @ankitsingh0188, you can check more about CR in: https://www.drupal.org/community/contributor-guide/task/write-a-change-r..., and please, do not remove the tag without creating it.

Anyway, I've updated the patch with the new CR, removed the unnecessary implements. Moving back to NR

ankitsingh0188’s picture

Hi @murilohp

it's better if you add the interdiff between #24 & #29 because in interdiff we generally include the comment number and as per your interdiff it's between #6 & #29

interdiff old.patch new.patch > interdiff_[old_comment_number]-[new_comment_number].txt

ankitsingh0188’s picture

Title: Move metods from TourTipPluginInterface and deprecate this interface. » Move methods from TourTipPluginInterface and deprecate this interface.
murilohp’s picture

StatusFileSize
new4.21 KB

it's better if you add the interdiff between #24 & #29 because in interdiff we generally include the comment number and as per your interdiff it's between #6 & #29

Thanks for the review! The interdiff is actually from #24, but since the name of patch was 3276336-6.patch, I've named the interdiff accordingly.

Here's a new interdiff between #24 and #29 renamed.

murilohp’s picture

jonathanshaw’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/tour/src/TipPluginBase.php
    @@ -118,4 +118,18 @@ public function getSelector(): ?string {
    +  /**
    +   * Returns the body content of the tooltip.
    +   *
    +   * This typically maps to the Shepherd Step options `text` property.
    +   *
    +   * @return array
    +   *   A render array.
    +   *
    +   * @see https://shepherdjs.dev/docs/Step.html
    +   */
    

    Can @inheritDoc

  2. +++ b/core/modules/tour/src/TourTipPluginInterface.php
    @@ -10,49 +12,9 @@
    + * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Implements
    

    I think this should be Implement not Implements

NW for minor fixes, otherwise RTBC.

ankitsingh0188’s picture

Status: Needs work » Needs review
StatusFileSize
new8.51 KB
new2.88 KB

I have updated the patch as per #34.

ankitsingh0188’s picture

StatusFileSize
new8.49 KB

Status: Needs review » Needs work

The last submitted patch, 36: 3276336-35.patch, failed testing. View results

ankitsingh0188’s picture

StatusFileSize
new8.49 KB
new1.01 KB
ankitsingh0188’s picture

Status: Needs work » Needs review
murilohp’s picture

Status: Needs review » Reviewed & tested by the community

I was reviewing #38 and #34 was addreses, the patch looks and it's applying, so for me it's RTBC now.

  • catch committed 70098a68 on 10.1.x
    Issue #3276336 by ankitsingh0188, Jesse van de Water, murilohp,...
catch’s picture

Version: 10.0.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

I was looking at the two plugins that remove the interface and wondering whether they need to continue implementing it in case someone was using it as a type hint, but no one should be type hinting plugin implementations like that especially on an interface that not all plugins of that type implement anyway, so it's fine.

Committed/pushed to 10.1.x, thanks!

Status: Fixed » Closed (fixed)

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

quietone’s picture

Published the CR