Skip to main content

James Davidson

Show Navigation
Hide Navigation
  • Home
  • About
  • Blog
  • Contact

Drupal 8

Custom 'no results' handler in Drupal 8 Views.

6th November 2018

I recently had a requirement to have different 'no results' text display under different circumstances on a Drupal 8 site I was working on. It was much simpler than I thought and I'll share the text snippet I used. /** * Implements hook_views_pre_view(). */ function my_module_views_pre_view(ViewExecutable $view, $display_id, array &$args) { if ($view->id() == 'james_davidson_view' && $display_id === 'page') { $message = t("I'm sorry there are...
  • Read more about Custom 'no results' handler in Drupal 8 Views.
  • 1 comment
  • Add new comment

"Uncaught PHP Exception InvalidArgumentException: "$string ("") must be a string." when defining new permission in Drupal 8

15th June 2018

I recently defined a new permission in a custom module in Drupal 8. When trying to access the permissions page to assign roles to the permission I got an error.
  • Read more about "Uncaught PHP Exception InvalidArgumentException: "$string ("") must be a string." when defining new permission in Drupal 8
  • Add new comment
  • Find James Davidson on Drupal.org
  • Follow James Davidson on twitter
  • Follow James Davidson on Google+
  • Find James Davidson on GitHub
  • Find James Davidson on LinkedIn
  • Home
  • About
  • Blog
  • Contact

Copyright © James Davidson 2023

Website design by Katherine Cory