Rothamsted-Ecoinformatics / farm_rothamsted

Custom farmOS features for Rothamsted Research.
GNU General Public License v2.0
6 stars 1 forks source link

farm_rei Warning: Attempt to read property "value" on null #753

Closed mstenta closed 2 months ago

mstenta commented 3 months ago

This error appeared 6 times in logs this morning (via /log/%/edit):

Warning: Attempt to read property \u0022value\u0022 on null in Drupal\\farm_rei\\EventSubscriber\\LogEventSubscriber-\u003ElogPresave() (line 50 of \/opt\/drupal\/web\/modules\/farm_rei\/src\/EventSubscriber\/LogEventSubscriber.php) #0 \/opt\/drupal\/web\/core\/includes\/bootstrap.inc(164): _drupal_error_handler_real()\n#1 \/opt\/drupal\/web\/modules\/farm_rei\/src\/EventSubscriber\/LogEventSubscriber.php(50): _drupal_error_handler()\n#2 [internal function]: Drupal\\farm_rei\\EventSubscriber\\LogEventSubscriber-\u003ElogPresave()\n#3 \/opt\/drupal\/web\/core\/lib\/Drupal\/Component\/EventDispatcher\/ContainerAwareEventDispatcher.php(111): call_user_func()\n#4 \/opt\/drupal\/web\/modules\/log\/log.module(38): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher-\u003Edispatch()\n#5 [internal function]: log_log_presave()\n#6 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Extension\/ModuleHandler.php(409): call_user_func_array()\n#7 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Extension\/ModuleHandler.php(388): Drupal\\Core\\Extension\\ModuleHandler-\u003EDrupal\\Core\\Extension\\{closure}()\n#8 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Extension\/ModuleHandler.php(408): Drupal\\Core\\Extension\\ModuleHandler-\u003EinvokeAllWith()\n#9 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/EntityStorageBase.php(215): Drupal\\Core\\Extension\\ModuleHandler-\u003EinvokeAll()\n#10 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/ContentEntityStorageBase.php(900): Drupal\\Core\\Entity\\EntityStorageBase-\u003EinvokeHook()\n#11 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/EntityStorageBase.php(529): Drupal\\Core\\Entity\\ContentEntityStorageBase-\u003EinvokeHook()\n#12 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/ContentEntityStorageBase.php(753): Drupal\\Core\\Entity\\EntityStorageBase-\u003EdoPreSave()\n#13 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/EntityStorageBase.php(483): Drupal\\Core\\Entity\\ContentEntityStorageBase-\u003EdoPreSave()\n#14 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/Sql\/SqlContentEntityStorage.php(806): Drupal\\Core\\Entity\\EntityStorageBase-\u003Esave()\n#15 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/EntityBase.php(354): Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorage-\u003Esave()\n#16 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Entity\/EntityForm.php(293): Drupal\\Core\\Entity\\EntityBase-\u003Esave()\n#17 \/opt\/drupal\/web\/profiles\/farm\/modules\/core\/ui\/theme\/src\/Form\/GinContentFormBase.php(279): Drupal\\Core\\Entity\\EntityForm-\u003Esave()\n#18 [internal function]: Drupal\\farm_ui_theme\\Form\\GinContentFormBase-\u003Esave()\n#19 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Form\/FormSubmitter.php(129): call_user_func_array()\n#20 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Form\/FormSubmitter.php(67): Drupal\\Core\\Form\\FormSubmitter-\u003EexecuteSubmitHandlers()\n#21 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Form\/FormBuilder.php(597): Drupal\\Core\\Form\\FormSubmitter-\u003EdoSubmitForm()\n#22 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Form\/FormBuilder.php(325): Drupal\\Core\\Form\\FormBuilder-\u003EprocessForm()\n#23 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Controller\/FormController.php(73): Drupal\\Core\\Form\\FormBuilder-\u003EbuildForm()\n#24 [internal function]: Drupal\\Core\\Controller\\FormController-\u003EgetContentResult()\n#25 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/EventSubscriber\/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()\n#26 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/Render\/Renderer.php(627): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber-\u003EDrupal\\Core\\EventSubscriber\\{closure}()\n#27 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/EventSubscriber\/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\\Core\\Render\\Renderer-\u003EexecuteInRenderContext()\n#28 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/EventSubscriber\/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber-\u003EwrapControllerExecutionInRenderContext()\n#29 \/opt\/drupal\/vendor\/symfony\/http-kernel\/HttpKernel.php(181): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber-\u003EDrupal\\Core\\EventSubscriber\\{closure}()\n#30 \/opt\/drupal\/vendor\/symfony\/http-kernel\/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel-\u003EhandleRaw()\n#31 \/opt\/drupal\/web\/modules\/simple_oauth\/src\/HttpMiddleware\/BasicAuthSwap.php(54): Symfony\\Component\\HttpKernel\\HttpKernel-\u003Ehandle()\n#32 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/Session.php(58): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap-\u003Ehandle()\n#33 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session-\u003Ehandle()\n#34 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle-\u003Ehandle()\n#35 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/ReverseProxyMiddleware.php(48): Drupal\\Core\\StackMiddleware\\ContentLength-\u003Ehandle()\n#36 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware-\u003Ehandle()\n#37 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware-\u003Ehandle()\n#38 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/StackMiddleware\/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState-\u003Ehandle()\n#39 \/opt\/drupal\/web\/core\/lib\/Drupal\/Core\/DrupalKernel.php(704): Drupal\\Core\\StackMiddleware\\StackedHttpKernel-\u003Ehandle()\n#40 \/opt\/drupal\/web\/index.php(19): Drupal\\Core\\DrupalKernel-\u003Ehandle()\n#41 {main}.

Seems to be coming from farm_rei code. I haven't seen this before, though, so I wonder if it's related to recent changes in farm_rothamsted? :thinking:

aislinnpearson commented 3 months ago

One to talk through on Tuesday @mstenta?

mstenta commented 3 months ago

@aislinnpearson Sure! Warnings like this usually are small things that are easy to fix. @paul121 may be able to see what the issue is easily - so probably won't require much discussion. I opened another one too that I just saw: #754

paul121 commented 2 months ago

I've fixed this and made a new 2.0.0-beta4 release of the farm_rei module: https://git.drupalcode.org/project/farm_rei/-/commit/8583ac8d8019dee13e47cefc443046b14a340f02

@mstenta I'lll also update the rothamsted modules dependency on farm_rei but you could deploy earlier if you feel so inclined

paul121 commented 2 months ago

Seems to be coming from farm_rei code. I haven't seen this before, though, so I wonder if it's related to recent changes in farm_rothamsted? 🤔

It is a good question. I don't think this is related to any recent changes. It might just be that they started recording some seasonally relevant input logs which had material quantities and triggered this issue. Shouldn't have had any harm, though. Will be curious if this happens again!