I have installed the module and installed Views module, too.
After I have saved the field, I get this error message.
TypeError: Unsupported operand types: array + null in Drupal\office_hours\Plugin\views\field\FieldBase::viewsFieldData() (line 81 of modules/contrib/office_hours/src/Plugin/views/field/FieldBase.php).
office_hours_field_views_data()
call_user_func_array() (Line: 400)
Drupal\Core\Extension\ModuleHandler->invoke() (Line: 193)
views_views_data() (Line: 236)
Drupal\views\ViewsData->Drupal\views\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 244)
Drupal\views\ViewsData->getData() (Line: 154)
Drupal\views\ViewsData->get() (Line: 1191)
Drupal\views\ViewExecutable->initQuery() (Line: 885)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers() (Line: 1055)
Drupal\views\ViewExecutable->_initHandler() (Line: 913)
Drupal\views\ViewExecutable->initHandlers() (Line: 2330)
Drupal\views\Plugin\views\display\DisplayPluginBase->preExecute() (Line: 1707)
Drupal\views\ViewExecutable->preExecute() (Line: 1642)
Drupal\views\ViewExecutable->executeDisplay() (Line: 81)
Drupal\views\Element\View::preRenderViewElement()
call_user_func_array() (Line: 111)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 797)
Drupal\Core\Render\Renderer->doCallback() (Line: 386)
Drupal\Core\Render\Renderer->doRender() (Line: 204)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 239)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)
I hope someone can help me. I can no longer uninstall the module either.
Thank you very much...
Drupal 10.1.8
PHP 8.1.27
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | office_hours-3421574.patch | 717 bytes | abhishek_gupta1 |
Comments
Comment #2
Nickstedt commentedComment #3
abhishek_gupta1 commentedComment #4
abhishek_gupta1 commented@Nickstedt , I have fixed the issue . please kindly review the patch file
Comment #6
johnvThe patch does not add the data in both cases.
i used the following construct:
Since it breaks you system, i will release now.
Comment #7
rang501 commentedI just updated to 1.15 and it seems to be broken
TypeError: Unsupported operand types: array + null in Drupal\office_hours\Plugin\views\field\FieldBase::viewsFieldData() (line 81 of modules/contrib/office_hours/src/Plugin/views/field/FieldBase.php).
Comment #8
ethangeorgi commentedDitto: we just updated to 1.15 and it seems to be broken for us as well. I don't see that the patch, or the "construct," are in the new code.
Comment #9
johnvPlease make sure that you truly have 1.15. It was released shortly after 1.14, which does not have the patch.
Also make sure that all caches are refreshed.
Please report back. I will check again.
Comment #10
ethangeorgi commentedSure. I just ran composer update and it had nothing new.
composer info drupal/office_hours
name : drupal/office_hours
descrip. : Defines a 'weekly office hours' field type, allowing you to specify when an Entity is open or closed.
keywords :
versions : * 1.15.0
type : drupal-module
license : GNU General Public License v2.0 or later (GPL-2.0+) (OSI approved) https://spdx.org/licenses/GPL-2.0+.html#licenseText
homepage : http://drupal.org/project/office_hours
source : [git] https://git.drupalcode.org/project/office_hours.git 8.x-1.15
dist : [zip] https://ftp.drupal.org/files/projects/office_hours-8.x-1.15.zip 8.x-1.15
path : /Users/ethan/Documents/Lando/rpi-registrar/web/modules/contrib/office_hours
names : drupal/office_hours
Drupal Available Updates Report says
Office Hours 8.x-1.15
Includes: Office Hours
Flushing the cache gives me
The website encountered an unexpected error. Try again later.
drush ws gives me
3158 16/Feb 07:57 php Error TypeError: Unsupported operand types: array + null in Drupal\office_hours\Plugin\views\field\FieldBase::viewsFieldData() (line 81 of /app/web/modules/contrib/office_hours/src/Plugin/views/
Comment #12
johnvPlease test new dev version.
The patch removes the error message, but does not resolve the root cause.
I do not understand this this can happen.
You may have problems using the new 'season' and 'timeslot' fields in Views (to be used as columns in a view).
Comment #13
ethangeorgi commentedThe dev version works for me. The site I'm testing with loads now, without errors. It was not using new "season" fields.
I can see the new code from the patch in this version of FieldBase.php, and I couldn't in 1.15, so that looks better.
I am concerned about "does not resolve the root cause."
Thanks for your work on this!
Comment #14
johnvThanks for your help.
Comment #16
johnv