Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Let's take this route:
some_route:
path: /example/{argument}/{entity_test}
defaults:
_entity_form: 'entity_test.edit'
options:
parameters:
argument:
type: 'argument_type'
When this route is resolved next PHP error pops up:
Notice: Undefined offset: 1 in Drupal\Core\Entity\EntityResolverManager->setParametersFromEntityInformation() (line 181 of core/lib/Drupal/Core/Entity/EntityResolverManager.php).
This happens only when the non-entity parameter comes first. The "test only" test proves the bug.
Proposed resolution
Fix it.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff.txt | 928 bytes | claudiu.cristea |
#7 | 2776055-7.patch | 2.58 KB | claudiu.cristea |
routing_error-test-only.patch | 1.74 KB | claudiu.cristea | |
Comments
Comment #2
claudiu.cristeaAnd the fix.
Comment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #6
dawehnerWhy do we not use
$this->assertEquals
as in every other patch? I know why you did that, but it might confuse people as every phpunit documentation uses$this->assertEquals
Comment #7
claudiu.cristeaOK :)
Comment #8
claudiu.cristeaReveal the test-only patch in the list.
Comment #9
dawehnerLooks perfect for me
Comment #10
alexpottNice fix. Committed and pushed 9bc59ded3e700fe2e46907df41d06998a9ec3a47 to 8.2.x and 8091985 to 8.1.x. Thanks!