The changes in #3421456: Fix tests introduced a bug in a call to function getRequestForPath(..)

change

Getting the error now:

error

Should be reverted back.

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:

Comments

veronicaSeveryn created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new976 bytes

@veronicaSeveryn fixed the issue and created Patch.

greg boggs’s picture

Hi Abhikeh Gupta,

Lets keep using findMatchingRedirect rather than switching to a different method while fixing this issue since findMatchingRedirect was working previously and was tested.

To improve workflow, we will need Merge Requests and not patches.

greg boggs’s picture

Status: Needs review » Needs work
niklan’s picture

Having the same issue.

UPD. Whoops, sorry folks, I was lost a bit, this is an easy_breadcrumb issue :) Btw, this issue is only reproduced with a dev branch 2.0.6 works fine.

paul_serval’s picture

Patch attached. Using injection for redirect.repository and findMatchingRedirect function

greg boggs’s picture

looks good, can we get a MR for Git lab CI testing?

spuky made their first commit to this issue’s fork.

spuky’s picture

Status: Needs work » Needs review

Was thinking ok lets do the work of converting the patch to am MR ( can't be that hard )

Learned a lot about Tests and CI ;-)

Got all tests to pass that where passing before the MR

I am still not sure If it is the right solution to the problem since it adds a dependency on the redirect module

Status: Needs review » Needs work

The last submitted patch, 7: easy_breadcrumb_3440889_Broken_findMatchingRedirect_call_7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

spuky’s picture

Ok I give up on trying to fix or get pass the 2 Remaining PHP unit tests...

I am not even sure if it is worth spending the time on fixing the testing of 3 Year old update code...
Problem seems to be that the Update function is checking the config against the already installed Schema

one would need to create SQL files for those tests...

So the status of the merge request is:

  • reverted the Problematic code from Issue 3421456
  • added a // @phpstan-ignore-next-line to not create a dependency against redirect module
  • added redirect module and path_alias (maybe useful for future tests..)
  • added cspell wordlist
  • fixed some typos
  • fixed the testAdministration Test..

my suggestion would be to remove the 2 failing tests (test8006DefaultConfigurationUpdate, test8006AfterFormSaveConfigurationUpdate)
to make contributions not that frustrating.. ( although I learned a lot )

spuky’s picture

Status: Needs work » Needs review
norman.lol’s picture

Issue summary: View changes
norman.lol’s picture

Priority: Normal » Major
norman.lol’s picture

Assigned: Unassigned » norman.lol

Unfortunately the MR now contains lots of unrelated fixes. I agree with most of these improvements but they must be fixed separately. Here we want to fix the issue mentioned in the title.

The most important thing to understand is that we must not inject a service that might not exist. Since the redirect module is not a dependency of the easy_breadcrumb module the redirect.repository service was called only inside a request: if ($this->moduleHandler->moduleExists('redirect') { ....

I will now open another MR to solely revert the unfortunate changes from #3421456: Fix tests. This will fix this issue. We might then open follow-up issues to fix the other stuff.

norman.lol’s picture

Assigned: norman.lol » Unassigned
Status: Needs review » Reviewed & tested by the community

Let's get MR !112 in before we create follow-up issues. For me it fixes the issue.

spuky’s picture

+ 1 for this simple merge (was carried away.. by trying to get fixes for test)

greg boggs’s picture

Status: Reviewed & tested by the community » Fixed
greg boggs’s picture

Ok. I think I did that right.

For the tests, lets try again to fix what we can, for annoyingly difficult tests on old update hooks and such, lets just remove the problem tests. The important bit with the tests is that the tests pass, not that we have great coverage.

Status: Fixed » Closed (fixed)

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