This is a rather strange one that I was only able to replicate when enabling other modules (such as the 'Feeds' module) but irregardless; the issue does appear to be with this module as altering the code locally fixes it.
To Replicate:
* Enable the Devel module
* Enable the Feeds module
* At this point you should be met with an error and be unable to access your site
I did some investigating and noticed the problem appears to originate in devel.module when setting the link template (in devel_entity_type_alter()). I did a var_dump of the values of getLinkTemplate() and sometimes the value is not preceded by a / as is required (see EntityType::setLinkTemplate()).
I have altered the code slightly to check if the value doesn't start with a / and if so to prepend it with one.
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#4 | devel-link_templates-2444077-4.patch | 1.21 KB | marc.groth |
#1 | devel-link_templates-2444077-2.patch | 1.23 KB | marc.groth |
Comments
Comment #1
marc.groth CreditAttribution: marc.groth commentedPatch attached.
After applying this patch I am unable to replicate any issues. It would be good to get this reviewed/committed if at all possible.
Happy to fix up any issues if there are any.
Cheers,
Marc
Comment #2
marc.groth CreditAttribution: marc.groth commentedUpdating status.
Comment #4
marc.groth CreditAttribution: marc.groth commentedWhoops! I patched it in the wrong context. Re-applying patch...
Comment #5
marc.groth CreditAttribution: marc.groth commentedComment #7
marc.groth CreditAttribution: marc.groth commentedHmm the issue now seems to be with the tests and not the patch itself, so updating the status again.
Comment #8
willzyx CreditAttribution: willzyx commented@marc.groth I think the problem should be addressed to Feeds module
In Feeds code i see
\Drupal\feeds\Entity\FeedType
and
\Drupal\feeds\Entity\Feed
The links definition should be changed as per #2281645: Make entity annotations use link templates instead of route names.
Feel free to reopen if you think that this issue must be addressed to devel
Comment #9
marc.groth CreditAttribution: marc.groth commentedHey @willzyx
Thanks for such a speedy response!
I had a look and as far as I can tell the URL's all start with / in the Feeds module. Bare in mind that entity.feeds_feed.canonical (for example) refers to the route and if you look in the feeds.routing.yml file you'll see that the URL does indeed start with /. In fact I checked and they all do.
The reason I think this is an issue with the devel module is because when I did a var_dump() in the setLinkTemplate() function, the only ones coming back with URL's not starting with / were devel-related ones.
I'm not too familiar with either of these modules (or D8 for that matter) so I could be completely wrong; but could you just double check again? Also review the patch if you could, which is very minor and as I say just checks for / before attempting to call the setLinkTemplate() function.
Let me know if you need any further investigation.
Cheers,
Marc
Comment #10
marc.groth CreditAttribution: marc.groth commentedForgive me... I didn't properly read the thread you sent. I didn't realise you can't reference route names and instead have to use actual links.
And it's only Monday....... haha :)