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.
When adding a crop type via the form located at /admin/config/media/crop/add
, the following fatal error is thrown:
Recoverable fatal error: Object of class Drupal\Core\Link could not be converted to string in Drupal\Core\Database\Statement->execute() (line 59 of core/lib/Drupal/Core/Database/Statement.php).
The crop type is still added, but it obviously quite confusing to the user.
This error is caused by the following line in the save method of the CropTypeForm class:
$context = array_merge($t_args, array('link' => Link::createFromRoute($this->t('View'), 'crop.overview_types')));
To fix this, the Link
element being created needs to have its toString()
method called. A patch has been attached.
Comment | File | Size | Author |
---|---|---|---|
fatal-error-adding-crop-type.patch | 687 bytes | Scott Robertson | |
|
Comments
Comment #3
woprrr CreditAttribution: woprrr as a volunteer and at NeoLynk commentedYes ! you right. This error came from #2855792: Replace all of deprecated usages during refactor. I didn't see this error (pehaps cache) during tests.
Thank you to your help/patch. This Major change need to out new minor release to have stable release.