#2891215-99: Add a way to track whether a revision was default when originally created added a new entity flag "Default revision" in this commit. The Rules Autocomplete test fails because it does not yet include this in the node autocomplete expected results. Hence the $expected and $results arrays do not match.

This change is only in core 8.6 and 8.5, not 8.4, so it should be a simple fix, and we can use the core version checking just as we've done before, when descriptions have changed, etc.

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Here's a patch which adds the new 'default revision' flag for core 8.5 and above. Previously we only needed to change the text, so the inline conditionals were simple. Now, we need to conditionally add two new elements to the array, but also keep them in the required order. As we don't add keys to the expected array and rely on the automatic numeric numbering I could not simply add the new values at the end in a new statement. So I used array_merge and an inline conditional. It works, but looks a bit ugly and might not be very readable. To make the patch simple to understand I have not indented the main set of array items for now. This can be done in a later patch when/if we have agreement that this is how we want to solve the problem.

Also, automated testing is currently broken for Rules at 8.5 and up - see #2936553: Rules kernel tests fail with "Creating default object from empty value". Unfortunately one of the failing tests is the Autocomplete test, so the change in this patch will not actually get checked at the moment. But I have tested it locally and it fixes the problem (which I only discovered during local testing when working on that other issue.) When the core issue is fixed this patch can be retested.

jonathan1055’s picture

Title: Autocomplete test needs new field "Default Revision" » Autocomplete test needs values for "Default Revision" flag
Status: Active » Needs review
StatusFileSize
new1.82 KB

Here's the patch corrected to pass PHPCS coding standards.

fago’s picture

Status: Needs review » Postponed

Sounds good, but let's postpone this until we see that it does not break testcoverage!

-> Postponed on #2936553: Rules kernel tests fail with "Creating default object from empty value".

jonathan1055’s picture

Yes, we need to hold off on this as the core change has actually been reverted out from 8.5.x and currently only exists in 8.6.x - see #123 on #2891215-123: Add a way to track whether a revision was default when originally created

jonathan1055’s picture

Status: Postponed » Needs review

The change has now been put back into core 8.5 - see #2891215-135: Add a way to track whether a revision was default when originally created. So the patch in #3 above should work exactly as before, and fix the tests for 8.5+. Re-queuing to check this.

jonathan1055’s picture

Status: Needs review » Reviewed & tested by the community

The tests now pass at 8.6 and 8.5 with this patch, and 8.4 still passes as expected.
Would be nice to commit this, then we will have all green test passes for all three core versions.

  • fago committed b0ba06e on 8.x-3.x authored by jonathan1055
    Issue #2936679 by jonathan1055: Autocomplete test needs values for "...
fago’s picture

thx, committed.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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