- Issue created by @leopathu
- Status changed to Postponed: needs info
7 months ago 9:13pm 21 April 2024 - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Can you turn on verbose error reporting from admin/config/development/logging and provide the full stack trace? Thanks
- Status changed to Active
7 months ago 6:30am 22 April 2024 - ๐ฎ๐ณIndia leopathu
Here is the Logs info
The website encountered an unexpected error. Try again later. Drupal\Component\Plugin\Exception\PluginNotFoundException: The "default_image" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php). Drupal\Core\Entity\EntityTypeManager->getHandler('default_image', 'storage') (Line: 192) Drupal\Core\Entity\EntityTypeManager->getStorage('default_image') (Line: 139) Drupal\views\Plugin\views\field\EntityLabel->preRender(Array) (Line: 1518) Drupal\views\ViewExecutable->render() (Line: 199) Drupal\views\Plugin\views\display\Page->execute() (Line: 1645) Drupal\views\ViewExecutable->executeDisplay('page_2', Array) (Line: 81) Drupal\views\Element\View::preRenderViewElement(Array) call_user_func_array(Array, Array) (Line: 111) Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 859) Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 421) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240) Drupal\Core\Render\Renderer->render(Array, ) (Line: 238) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239) Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50) Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
I couldn't reproduce this error by the following steps on a Drupal 10.2.5 site:
- Go to the media overview page (/admin/content/media).
- Add a new media by clicking the link(button) 'Add media'.
- In the 'New media' page(/media/add), add an Image media.
- In the 'New image' page(/media/add/image), fill in all required fields, such as name, image file(uploaded).
- Save this new image media.
- Go to the file overview page(/admin/content/files)
- Click the file link uploaded by that image media above
- The image file open as expected. No error
- ๐ฎ๐ณIndia leopathu
@Mingsong It is happening only for default image uploaded on image fields.
For example: Set a default image for any image field. and see the image file usage in the admin/content/files page. then you can get it. - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
This looks like the views entity label plugin on this view is conflating the file usage type with an entity type
The call to getStorage needs to check hasDefinition first
- Merge request !7660Issue #3442346: A new test for the "default_image" entity type does not exist error โ (Open) created by mingsong
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
A new test to reproduce this error in 10.2.x branch.
https://git.drupalcode.org/project/drupal/-/merge_requests/7660/diffs
- Status changed to Needs work
7 months ago 3:44am 23 April 2024 - First commit to issue fork.
- ๐ฎ๐ณIndia mohit_aghera Rajkot
@Mingsong can you please update the PR with latest 11.x and change the destination for 11.x
I've pushed the fix on the branch.
There seems one test case failure, however this is failing on 11.x head as well (on my local).
So not sure if this issue's change is the root cause of this one.Keeping this in needs work until we update the PR and pipeline is green.
- Merge request !7752Issue #3442346: The "default_image" entity type does not exist โ (Open) created by mingsong
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
Thanks @Mohit for the fix.
The origin branch is based on the 10.2.x branch and there are some conflicts if targeting 11.x branch.
So I created a another branch based on the 11.x branch and a new MR targeting the 11.x branch.
https://git.drupalcode.org/project/drupal/-/merge_requests/7752
We need to fix this issue for all active branches(10.2.x, 10.3.x and 11.x)
Cheers,
- Status changed to Needs review
7 months ago 1:56am 26 April 2024 - ๐ฎ๐ณIndia Kanchan Bhogade
Hi
I've tested MR !7752 on Drupal 10.2 and 11.x
MR is applied cleanly...Test Result:
No error for the default image uploaded on the image field on the file usage page and the "File Uses Page" is displayed.Adding Screenshots for references
RTBC+1Keeping in "Needs review" for Code verification
- ๐บ๐ธUnited States smustgrave
smustgrave โ changed the visibility of the branch 3442346-default-image-usage to hidden.
- Status changed to Needs work
7 months ago 2:23pm 28 April 2024 - ๐บ๐ธUnited States smustgrave
1) Drupal\Tests\file\Functional\FileImageTest::testDefaultImageFile Behat\Mink\Exception\ExpectationException: Current response status code is 500, but 200 expected. /builds/issue/drupal-3442346/vendor/behat/mink/src/WebAssert.php:888 /builds/issue/drupal-3442346/vendor/behat/mink/src/WebAssert.php:145 /builds/issue/drupal-3442346/core/modules/file/tests/src/Functional/FileImageTest.php:105 /builds/issue/drupal-3442346/vendor/phpunit/phpunit/src/Framework/TestResult.php:729 ERRORS! Tests: 1, Assertions: 9, Errors: 1.
Shows test coverage.
Left a comment on the MR though.
- Status changed to Needs review
7 months ago 5:30am 29 April 2024 - Status changed to RTBC
7 months ago 1:10pm 29 April 2024 - ๐บ๐ธUnited States smustgrave
Much better to me, thanks for taking care of that.
- Status changed to Needs work
7 months ago 11:17pm 29 April 2024 - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Nice one folks, couple of comments on the MR
- ๐ฎ๐ณIndia pradhumanjainOSL
pradhumanjain2311 โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia pradhumanjainOSL
@larowlan i didn't understand how to remove getValue call but i tried to reduce a loop please review.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Left a comment clarifying my point @pradhumanjain2311 - thanks