Hi,
I have added ENTITY REFERENCE field with Type of item to reference FILE. Everything works fine.
But I can not access submissions. There is an error
Drupal\Core\Entity\Exception\Undefined LinkTemplateException: No link template 'canonical' found for the 'file' entity type in
Drupal\Core\Entity\Entity->toUrl()

I have tested ENTITY REFERENCE field with Type of item to reference FILE on content type it works fine, no error.
is there any way to solve?

Comments

Eevvee created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new3.86 KB

The attached webform replicates this issue.

jrockowitz’s picture

StatusFileSize
new1.78 KB
jrockowitz’s picture

@Eevvee Welcome to the Drupal Community

I wanted the say "Hello" and encourage you to learn more about...

Watch video about helping us help you

Eevvee’s picture

Thank you very much, your patch works great .

jrockowitz’s picture

StatusFileSize
new1.97 KB

The attached patch includes checking file download access to make sure we don't link to a protected file.

  • jrockowitz committed e948988 on 8.x-5.x
    Issue #3005072 by jrockowitz, Eevvee: No link template 'canonical' found...
jrockowitz’s picture

Status: Needs review » Fixed

@Eevvee Congratulations on earning your first commit credit

I wanted the say "Thanks" for helping out with the Webform module. Learn more about...

Eevvee’s picture

Second patch does not allow to see webform view page.

  • jrockowitz committed 7d808ef on 8.x-5.x
    Reverting: Issue #3005072 by jrockowitz, Eevvee: No link template '...
jrockowitz’s picture

Status: Fixed » Needs work

@Eevvee I don't understand what you mean by…

Second patch does not allow to see webform view page.

Please provide more information and/or update the patch.

Eevvee’s picture

my-site/form/my-webform shows error "The website encountered an unexpected error. Please try again later."
This error shows only in that webform which have reference field.

I find an error
Error: Call to a member function getTokenUrl() on null in Drupal\webform\WebformMessageManager-> get() (line 281 of...

jrockowitz’s picture

That sounds like an indirectly related error.

Can you please test the patch on https://simplytest.me?

jrockowitz’s picture

Status: Needs work » Postponed (maintainer needs more info)

  • jrockowitz committed df52a5a on 8.x-5.x
    Issue #3005072 by jrockowitz, Eevvee: No link template 'canonical' found...
jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Fixed

I am almost certain that #12 is an unrelated issue that should be addressed in a follow-up ticket with an example of the broken webform.

Status: Fixed » Closed (fixed)

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