Comments

BigEngland’s picture

Assigned: Unassigned » BigEngland
fago’s picture

Assigned: BigEngland » Unassigned
omissis’s picture

Assigned: Unassigned » omissis
omissis’s picture

Hi, I have published a first draft of this ticket implementation in the following PR: https://github.com/fago/rules/pull/106
It's not complete yet, but it represents a starting point for further discussions, as I have a few questions(see on the PR comment).

dasjo’s picture

Status: Active » Needs work

updating the status to reflect the state of the pull request

dasjo’s picture

Assigned: omissis » Unassigned

I'm unassigning this for now, feel free to pick it up whenever you have time to work on it.
Cheers, dasjo

dasjo’s picture

Issue tags: +Contributor
amerie’s picture

Issue summary: View changes
StatusFileSize
new2.19 KB
amerie’s picture

Issue summary: View changes

I am not sure of the status of this issue based on the discussion in the pull request, but here is a simple, direct port of the "Text comparison" condition from Drupal 7 (based on the existing D8 "Data Comparison" condition).

fago’s picture

While I think we want to replace this functionality with #2681735: Add support for data matcher plugins, I think it's fine to complete this to have the functionality ported and working for now. Or do we want to avoid having this condition in the first place, so we do not have to keep supporting it during updates?

klausi’s picture

I didn't see any progress on the data matcher stuff so I think we should have a straight port of this functionality first. Let's worry about update path before beta.

rooby’s picture

Status: Needs work » Needs review

Based on previous comments, setting to needs review.

rooby’s picture

I have a rule where on user login it runs a condition where it checks the current page path using this plugin and then fires a redirect action.

When I log in and it runs I get:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "rules_text_comparison" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Clearing the cache doesn't help.

rooby’s picture

It seems that error was somehow related to my doing a config import from development to staging.
I'm pretty sure I did a 'drupal cache:rebuild' before running the config import but it didn't seem to help.

After clearing the cache from the performance UI it all seems to work again.

klausi’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

A test case is missing and please file a pull request against https://github.com/fago/rules/pulls

tr’s picture

Assigned: Unassigned » tr

I will write the test.

tr’s picture

Status: Needs work » Needs review
StatusFileSize
new6.77 KB

Here is a patch containing:

  1. src/Plugin/Condition/TextComparision.php - the port from #8, with cleaned-up coding standards.
  2. tests/src/Unit/Integration/Condition/TextComparisonTest.php - a new test with unit tests of this condition and all its options.
tr’s picture

StatusFileSize
new6.72 KB

Removed the unused 'use' statement.

fago’s picture

Status: Needs review » Reviewed & tested by the community

I didn't see any progress on the data matcher stuff so I think we should have a straight port of this functionality first. Let's worry about update path before beta.

oh yes, let's do not wait for this...

Patch is good and has test coverage.

  • fago committed 0f54e1e on 8.x-3.x authored by TR
    Issue #2281087 by TR, Amerie, fago: Port "Text comparison (text_matches...
fago’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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