- Issue created by @einarulfhednar
- 🇬🇧United Kingdom adamps
In Drupal Core, I can't find any entity classes that have a toString function, so this doesn't seem like its the right solution. I guess you probably have the wrong URL pattern
When I save content that has an automatic URL pattern of type `simplenews_issue` associated with it, I get the following error:
"Error: Object of class Drupal\simplenews\Entity\Newsletter could not be converted to string in Drupal\Component\Render\HtmlEscapeText->__construct() (line 31 of core/lib/Drupal/Component/Render/HtmlEscapeText.php).".
I have added the magic method `__toString()` to the Newsletter entity to solve the problem.
The following solution is an interim solution to the problem at hand, but the correct solution would be for the entity to provide all fields of the referenced entity (such as taxonomy terms) along with their tokens.
Needs work
4.0
Code
In Drupal Core, I can't find any entity classes that have a toString function, so this doesn't seem like its the right solution. I guess you probably have the wrong URL pattern