Problem/Motivation
Long error messages are appearing on a clean install of Drupal 9.0.8 and RestUI on the config page:
admin/config/services/rest
Steps to reproduce
- Start with a clean version of Drupal (9.0.8) installed with composer.
- Run "composer require drupal/restui"
- Enable module.
- Go to to main module config page and see this error message below.
If it's a configuration issue on my end, please let me know.
Thx.
Notice: Undefined variable: enabled_methods in Drupal\restui\Controller\RestUIController->listResources() (line 196 of modules/contrib/restui/src/Controller/RestUIController.php).
Drupal\restui\Controller\RestUIController->listResources()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: in_array() expects parameter 2 to be array, null given in Drupal\restui\Controller\RestUIController->listResources() (line 196 of modules/contrib/restui/src/Controller/RestUIController.php).
Drupal\restui\Controller\RestUIController->listResources()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
etc
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | WhatsApp Image 2021-02-01 at 07.51.38.jpeg | 36.41 KB | ilgnerfagundes |
| #11 | WhatsApp Image 2021-02-01 at 07.51.30.jpeg | 95.49 KB | ilgnerfagundes |
| #4 | restui-3185372-4.patch | 901 bytes | clemens.tolboom |
Issue fork restui-3185372
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bogdog400 commentedNote: the error messages disappeared after I enabled one of the APIs.
Comment #3
clemens.tolboomThis is caused by #3133488: shows resources as having a POST path when the POST method is not enabled
Comment #4
clemens.tolboomComment #5
clemens.tolboomComment #6
K.A.T. commentedThis patch worked for me! Also worked on D8.8.12.
Comment #7
cabita commentedThis patch worked for me! Thanks a lot.
Comment #8
voleger+1 for rtbc, patch works for me (drupal:9.1.0 on php:8.0)
Comment #9
psf_ commented+1 for rtbc, patch works for me (drupal:9.1.0 on php:7.4.13)
Comment #10
jnrfred commented+1 patch works for me.
Comment #11
ilgnerfagundes commented+1 patch works for me.
Comment #12
frocha commentedThe patch #4 works for me!
Thank you @clemens.tolboom
Comment #13
rosk0Thanks for the patch!
Works like a charm.
Comment #15
clemens.tolboomFor the record: I tried to use the issue fork @ d.o. ... when pushing I got
Not sure why so jumped back to old school workflow.