Krishna Mishra
Thank you so much, Your patch works
Appreciate so much for your help
- Status changed to Needs work
about 2 years ago 12:57pm 4 April 2023 - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Same error here after update to 9.5.x
In my case I have an extrafield that prints a view.In my settings I have
$config['system.logging']['error_level'] = 'verbose';
The error comes when trying to get the id from the handler on the info array and there is no key id.
- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
It is possible that some handlers need to have declared the id.
Example from https://www.drupal.org/project/broken_link/issues/2986545 β@@ -24,7 +24,10 @@ class BrokenLinkViewsData extends EntityViewsData { $data['broken_link']['table']['group'] = t('Broken links'); // Specify field real column name for additional entity fields. - $data['broken_link__referers']['referers']['filter']['real field'] = 'referers_value'; + $data['broken_link__referers']['referers']['filter'] = [ + 'real field' => 'referers_value', + 'id' => 'string', + ]; $data['broken_link__query_string']['query_string']['filter']['real field'] = 'query_string_value'; $data['broken_link__referers']['referers']['sort']['real field'] = 'referers_value'; $data['broken_link__query_string']['query_string']['sort']['real field'] = 'query_string_value';
- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
I saw that there is a custom text area for no result.
If I use the core handler, the error is gone, so I will review it.use Drupal\views\Plugin\views\area\AreaPluginBase; /** * Defines a views area plugin. * * @ingroup views_area_handlers * * @ViewsArea("no_results_message") */ class NoResultsMessage extends AreaPluginBase { /** * {@inheritdoc} */ public function render($empty = FALSE) { return [ '#theme' => 'no_results_message', ]; } }
- Status changed to Active
about 2 years ago 1:17pm 4 April 2023 - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
@Krishna Mishra, @drupalgreenhorn Review if you have custom filters or custom handlers in the view that failed, maybe they are not well implemented.
In some cases, muting the warning is not the solution. - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Found the error.
I found that I have translated the view.
Example:
es/views.view.myview.ymldisplay: default: display_options: ... empty: area: content: value: "<p>Β‘No se han encontrado productos!</p>\r\n" format: basic_html ...
Original views.view.myview.yml
empty: no_results_message: id: no_results_message table: views field: no_results_message relationship: none group_type: group admin_label: '' plugin_id: no_results_message empty: true content: value: '<p>No products found!</p>' format: basic_html tokenize: false
That seems to be the reason why the display handler does not find the id, the table, or the field. At least in my case.
- πΊπΈUnited States j_s
I also encountered this issue and patch #9 helped.
Now I have some more warnings:
Warning: Undefined array key "table" in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 82 of core/modules/views/src/Plugin/ViewsHandlerManager.php).
Warning: Undefined array key "field" in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 83 of core/modules/views/src/Plugin/ViewsHandlerManager.php).I get that it may be some contributed module that isn't implementing something properly. But it might be nice for Drupal to do some isset checks so as to avoid these warnings coming up in log when they don't seemingly affect functionality. Or at least make the error message more useful to help identify what's wrong. As it is, the stack trace doesn't help.
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
In my case there was a broken sort handler in the view. If you take a look at the view in the UI you may be able to see the problem.
- π©πͺGermany cweiske
I had a
hook_views_pre_view
function that overrode$view->display_handler
options. One of the options I changed did not exist, so the error was indeed helpful that something was wrong with my code.function mymod_view_pre_view_article_filter(ViewExecutable $view) { $defaults = [...]; $filters = $view->display_handler->getOption('filters'); $filters['field_tags_target_id']['value'] = $defaults['tags']; $filters['query']['value'] = $defaults['query']; //this "query" filter did not exist }
- π§πͺBelgium hoebekewim
You can fix this in some cases by going to the relevant views, saving it, and also save it's translations.
Then do a config export and the missing keys will be added to avoid it in the future.It is probably caused by updates on Views which were not applied to your config for some reason.
- πΊπΈUnited States maskedjellybean Portland, OR
Wow, #20 was the cause of my error as well. No idea how you figured that out based on the error message but I appreciate it!
Seeing these in sets of three when trying to apply changes to the VBO field
Warning: Undefined array key "order_id" in Drupal\views\Plugin\views\HandlerBase->getEntityType() (line 798 of /var/www/html/web/core/modules/views/src/Plugin/views/HandlerBase.php)
Warning: Trying to access array offset on value of type null in Drupal\views\Plugin\views\HandlerBase->getEntityType() (line 799 of /var/www/html/web/core/modules/views/src/Plugin/views/HandlerBase.php)
nvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (line 137 of /var/www/html/web/core/modules/views/src/ViewsData.php).